Hello Nintex Community!
I was faced with a challenge of updating the Parent Document relationship column of a given document/file. The "Update List Item" and "Office 365 update items" actions failed. I discovered that it might be possible to utilize the "Call HTTP Web Service" action to perform the column update.
I discovered several golden nuggets of data that helped me piece together the solution for updating a multi-selection lookup using the REST API.
Solution Overview:
1. Build String - File Path
Workflow Context: List Name = name of the list or library
Current Item: Name = file/document name with the extension (e.g.: QMS-Manual.docx)
2. Set Workflow Variable - Library Name
Reference: My workflow is dynamic and accepts input from multiple source library workflows.
3. Build String - File URL
Reference: In this example, my parent approval workflow approves a document and converts the file document to PDF. This workflow is looking for the converted PDF file name.
4. Build Dictionary - metadataObject
Important Note: {ListName} may need to be retrieved from the <EntityTypeName> element by navigating to this URL:
https://{entity}sharepoint.com/sites/{site-name}/_api/web/lists/getbytitle('{list-name}').
5. Build String - Parent Document Data
Important: Select return type for the Multiple Selection Lookup will need to be "Lookup Ids, Comma Deliminted".
Note: Be sure the variable is captured between the left and right brackets r ].
6. Build Dictionary - request
Note: Define "results" as a Dictionary type variable.
7. Build Dictionary - Request Header
8. Build Dictionary - Request Body
Note: Define the Key as "ColumnName+Id". In my example, the Parent Document column is defined as Key "ParentDocumentId". Track down the EntityPropertyName by using this URL:
https://{entity}sharepoint.com/sites/{site-name}/_api/web/lists/getbytitle('{list-name}')/fields. The EntityPropertyName will provide you with the column name without spaces. Append "Id" to the EntityPropertyName and that will become the Key.
9. Build String - wsEndPointURL
Note: txtID is a variable that contains the ID of the converted PDF item.
10. Call HTTP Web Service - Update Parent Document
Fellow Nintex Community Members, I hope you find this information useful.
#Office 365, #MERGE, #REST, #Multiple Selection Lookup