I've seen this question asked in different forms, but not necessarily with this configuration and I can't seem to figure this out.
I have 2 lists (List A and List B)- each have a multi-value lookup column that point to the same List C.
I cannot figure out how to use a workflow to lookup data in List A from the lookup column (List C) and then update List B's lookup column (also list C) with the same values.
As far as I can tell so far it involves building a string out of a set variable action that looks up the values from the lookup column in List A, but I cannot seem to get this working. Any suggestions?
Solved! Go to Solution.
If I've well understood what you are trying to do is to copy the value of a multi lookup column to paste it in a multi lookup column in another list ?
Do you also need help to get the value of a multi lookup column ?
That is correct. Both are multi select lookup columns pointing to the same parent list. So if the lookup column in List A from List C (Parent) has values of Cat, Dog, Bird I want to update the lookup column in List B (Same List C Parent Column) to also store values of Cat, Dog, Bird.
ok and you need to query List A to get items that have Cat, Dog and Bird values for the multi value lookup column ? Or do you want to loop through all items of list A ? How do you know which items of list B have to be updated ?
I already know which list items need to be updated based on separate criteria that links the two list items together - I'm just struggling with how to update the lookup columns
For a multi lookup value, it should look like this :
2;#Cat;#3;#Dog;#4;#Bird (item ID;#item Title;#another item ID;#another item Title)
To get this value from an item, you can call the following web service using "call web service" action :
<?xml version="1.0" encoding="utf-8"?>
<m:listName>The name of the list where you want to retrieve the multi lookup value</m:listName>
<FieldRef Name="ID" LookupId="TRUE" />
<Value Type="Text">ID of the item where you want to retrieve the multi lookup value</Value>
<FieldRef Name="internal name of the multi lookup column" />
Then to extract only the value of the column, you can use a Query XML action :
Then in your variable single_line_of_text_variable_to_store_result you will have the correct format of the multi lookup value column and you will be able to update the item using the "Update item" action and this variable.
Hope it helps
Why would you prefer to use the Call webservice rather than the 'Query List' action. It's much simpler to implement (but less powerfull of course), but in this case, it would make the job.
for updating those kind of columns, please refer to this post on my personal blog. Hope that helps.
Caroline Jung answer is correct if you want to go down the path of using web service calls, however, Alexandre JOLY suggestion is more user friendly and power user focused. Depends on the requirements and audience at the end of the day