I am using JavaScript to upload a file in a document library, like this
clientContext = new SP.ClientContext.get_current();
oWebsite = clientContext.get_web();
oList = oWebsite.get_lists().getByTitle("The_List_Where_I_Upload");
fileCreateInfo = new SP.FileCreationInformation();
fileCreateInfo.set_overwrite(true);
fileCreateInfo.set_url(filename);
fileCreateInfo.set_content(content); /*the content is generated somewhere else, it's not important in this question*/
this.newFile = oList.get_rootFolder().get_files().add(fileCreateInfo);
clientContext.load(this.newFile);
The code works, but let's say, at the same time when I upload the file I also want to set the value of another column in the document library, for example Username or User Address.
I tried with `fileCreateInfo.set_item('Username', value); but it throws an error saying
set_item is not a function.
Is it possible to set other columns values while uploading a file to a document library?