Automatically fill field when uploading document to library

When uploading a document to a library, I need the user to be prompted to choose an option from a choice field to classify that document. This is already a required field in SharePoint, but the document uploads without the user being prompted to set the choice field.

My document library is filtered by a view, so as soon as the doc is uploaded, it is not visible for the user to change.

I have looked at this article: Update metadata of uploaded documents in List or Library — SharePoint forms but can't figure out how to make it work with a choice field.

image

Hello @lzaf,

For instance, you can disable the control if the choice field is blank:

if(!fd.field('Field1').value) {
    fd.control('SPDataTable1').readonly = true;
}
else {
    fd.control('SPDataTable1').readonly = false;
}

@lzaf - Did you ever get this to work? I have a related question and that same article you referenced was what I looked at also and could not translate it into my needs. I would welcome any feedback on what you did in this case.

Hello @shedev,

Please share the code you are using to update the data for the uploaded files and specify the column types in the child list: Title -single Line; Status- Lookup field, etc.

Most probably the issue is in the invalid value for the column type.

@Margo - thank you for asking. I have updated the related post with more information. Please let me know if it is helpful. I suspect there is a difference between list-to-list and list-to-DL operations but I can't figure it out. The update metadata documentation is very confusing to me; I did try that too.