I am trying to update a Hyperlink Column on a sharepoint list after new form submission. I have not been able to find the right code to do this and everything I try just gives me a Javascript error or doesn't update the item. I need to do this after the new item is created as it is using a calculated value from the new item ID and you don't get this until you create the item.
Would anyone have an example code on how to update the column directly after the form is submitted?
Thank you for the reply. However that does not solve my question. The column in the SharePoint list is of type Hyperlink and is a multi-value property. Through some trial and error and looking at PnP functions on other sites I was finally able to figure it out. The below code works to update a multi value column like a Hyperlink one.
var docURL = 'https:/myurl.com/myothersite'
//Get the SharePoint list
var list = pnp.sp.web.lists.getById(listId);
//Update the saved item
list.items.getById(itemId).update({
DocumentFolder: {
Description: docURL,
Url: docURL,
},
}).then(function() {
console.log(docURL);
});