SharePoint Asked on January 8, 2021
I would like to update a multiple lookup field in SharePoint Designer 2013. OOTB this is not possible. In SharePoint Designer 2010 it was possible. Now I would like to do this with for example a REST API call in the SharePoint Designer 2013 workflow. How can I do this?
UPDATE
I try first to make it work in javascript but it is not working yet. What I am doing wroning in this script?
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script><script type="text/javascript">
$(document).ready(function(){
//replace your list title
$.ajax({
url: "https://myCompany.sharepoint.com/sites/DMS-WF-Test-Infra/_api/web/lists/getByTitle('TestKH')/items(5)",
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify({
'__metadata': {
'type': 'SP.Data.TestKHListItem',
},
'SBSId': { "results": [1,2] }
}),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest" : $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "PATCH",
"If-Match": "*"
},
success: function (data) {
console.log("done");
},
error: function (err) {
console.log(JSON.stringify(err));
}
});
})
</script>
You can make API calls via the "Call HTTP Web Service" action available in SharePoint 2013 workflows. More information can be found here:
Working with Web Services in SharePoint Workflows using SharePoint Designer 2013
Answered by Callum Crowley on January 8, 2021
Not sure how to make the API call in SP Designer (it's a hassle!) but your data should be something like this:
'ColumnNameId': {"results": [59, 60] }
Note that you need to add 'Id' to the column name. The results object contains an array of the IDs of the lookup items.
Answered by JJD on January 8, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP