cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

there is not an OOTB form functionality that would update lookup list. you will have to manage this with workflow or write your own javascript solution.

value of lookup field with multiselection allowed is an array of key-value pairs separated by a ';#'

so if you went by workflow way you would need to turn the array into collection with regular expression action.

then loop through collection and for every element parse out ID value with another regular expression action.

finally you could make your update.

JSON which ‌ mentioned is probably valid for SP online, but looking at your profile you seem to be on on-prem.

anyway, I would still like to know what a real process might be managed by a status field maintained this way.

I don't see it reliable approach at all.

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

Marian Hatala‌ but Dilip kumar‌ is not need to update the lookup field, but to query the lookup field in list B, to get relevant elements from the list A and then update those elements (or at least this is what I understood from the discussion).

So whether after querying the lookup field you get JSON or semicolon delimited string it is still a structured string you can parse using regular expressions.

I noticed we are in on premise, I am also not sure if the query action will return JSON (it does if you query "Related Items" in the task element, so I thought it should behave similar ), nevertheless it is "querable" and certainly will return something to process.

Regards,

Tomasz

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

‌, as I understand it, once eg. 'val1' value is choosen in an item in lookup field in listB, he wants to update status field of val1-item in listA.

have I said somewhere he should update lookup field (in listB)? or does it imply somehow from my post? if so let me know I can correct it. I can not spot it on my own...

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

Do you have an example. It would be helpful if you can provide me with a step by step solution. I spent hours for this issue and im stuck. Appreciate if you can help here.

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

Dilip kumar‌ please confirm that what we understand is exactly you need - you want to update items in List A to which are in a multilookup field in List B? And that you do not want to update any lookup field, but a text field?

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

as well, specify what exactly you need help with - workflow, javascript, anything else?

as well, please confirm what platform you are on.

if you already have any partial solution post a screenshot/example and describe what/where exactly you have a problem. this could be a good start point.

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

Yes Correct Tomasz. I have a  List-A which has fields  Device(Single line of Text which is lookup in List B ), Status (Available,Locked)

In List-B when user selects few Devices in multi selection lookup and submit the request the status of all the devices in List A should be updated to Locked.

Thanks a on for helping me out.

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

Yes Correct Tomasz. I have a  List-A which has fields  Device(Single line of Text which is lookup in List B ), Status (Available,Locked)

 

In List-B when user selects few Devices in multi selection lookup and submit the request the status of all the devices selected by user in List A should be updated to Locked.

 

 

Thanks a ton for helping me out.

0 Kudos
Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

You should do as I said then:

  • Create a regular expression action as follows:
  1. use "Advanced lookup" to reach your multilookup field. Then click "fx" button.
  2. in the modal window choose return type as "Lookup Ids, comma delimited".
  3. Choose "Split" and put "comma" sign in pattern field. 

  • Save output of the action into the collection variable.
  • Create a foreach‌ loop on the collection variable from above. Output value in each loop run is your "List A item ID":

  • Then insert update list item‌ action inside the loop and configure it to point to your "List A" where item ID is equal to the current value of the extracted id from the collection you use for the loop:

  • That way set your "Status" column value.

In total this workflow should look like this:

Regards,

Tomasz

Reply
Workflow Hero

Re: Urgent: I have a multiple selection lookup in my list. I need to update the status of all the selected lookup values back in source list from where the values are lookup

Jump to solution

Hi Tomasz,

Thanks a ton for the help.

0 Kudos
Reply