Update Multiple Values Lookup  in SharePoint Online


Badge +7

Hi All

 

How to Update Multiple Values Select Lookup ?

    We can Update Multiple Values Select Lookup column using REST API in Nintex Workflow

Why Rest ?

   When you are using SharePoint Default Update  Action to update, you will get below error, to avoid this we have use REST API 

 

Error Detail  When use Update List Item Action216350_pastedImage_1.png

 

{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"A 'PrimitiveValue' node with non-null value was found when trying to read the value of a navigation property; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected."}}} Bad Request

 

about  this error you may heard, like Microsoft bug or Nintex  bug we cannot update multi select lookup column in SharePoint online Etc

but  We Can Update 

here you can get the solution for that,

using REST API we can update the Multi select lookup column.

 

 Key Point are 

1)Pass value in array  =  [21,42]

2)Column name id      =  ColumnNameId

 

Step by Step 

 216351_pastedImage_1.png

1) Build metadata with you List/Library  SP.Data.AssetsLibraryItem ( for Library) or SP.Data.AssetsLibraryListItem   ( for List)

 

216352_pastedImage_2.png

 

2) Pass your Multi Select Value ID in to the Text Variable

 

216353_pastedImage_3.png

3)Get Value in Dictionary Variable "here the out put Result is a dictionary Variable"

216362_pastedImage_1.png

 

 

4) Pass the Value in to you column name ID   Ex "ColumnnameId" the Key value should be  "Columnname+Id "

 

216358_pastedImage_2.png

 

5) usual Update Merge Method , get this in to Request Header 

216360_pastedImage_4.png

 

6 Finally {Workflow Context:Current site URL}‍_api/web/lists/GetByTitle('Listname')/items(‍{Variable:GetID}‍) with Post Method 

 

216361_pastedImage_5.png

That is it, all good,  Enjoy.......


4 replies

Badge +4

Hi Ranjith, What needs to give in SecurityDigestL Variable?

Userlevel 3
Badge +12

Hi Ranjith,


I have similar requirement, what value to pass for "SecurityDigestL" variable? I tried to the value using "Web Request" action, but can not get the "request digest" value in SharePoint Online.

@ranjca ,

Thank you for this interesting solution.
I didn't quite get the "column name+ID" part , 
My multivalue column is Roles and which ID should it be concatenated with?

Also, the value for SecurityDigestL variable

Thanks,
Pooja

Badge +10

I think it better to use the workflow item "Office 365 update items" instead of normal update item, it works.

Reply