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


Badge +3

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


25 replies

Userlevel 6
Badge +15

So just to be clear..

1) A user selects multiple items in a dropdown list on your form (?)

2) The items selected need to have their status updated in the original list that the dropdown is sourced from.

If that's right... you'll need to put those multiple items into a collection, then loop through the collection and update that selection in the list with whatever status is required.

Will the status always be the same?

Badge +3

Hi Rhia,

Thanks for the reply. Yes you are correct but the lookup is not a dropdown its a multiple check box selection.

The status will change. when a item is created status will be locked and when item is modified it should change to allocated .

I am bit new to nintex . If possible can you provide me a step by step solution with images. It will help me a lot and save some time.

Appreciate all your help.

Thanks

Dilip Kumar

Badge +3

Can you please help with this issue

Badge +3

Request you help on this. can you provide  me a step by step info on how to achive this. i am bit new to nintex

Userlevel 6
Badge +15

I'm sorry I'm not available right now to walk you through the steps (about to get in a car to go to a flight) but let me call some of the workflow avengers here...

Badge +3

Thanks happy.pngif any one can help me with this that would be great!

Userlevel 5
Badge +14

can you describe in details what's your business requirement you need to accomplish?

updating anything in lookup list based on selection(s) made in single list item sounds to me to be a design flaw..

what should eg. happen if two or more list items are being created/changed at about same time with different selections, what status should be applied to lookup item?

what should eg. happen if a new  item is created and another item changed and they both should set status of the same lookup item, what staus should be applied.

Badge +3

I have a ListA and ListB. In ListB i have a lookup column(Multiple selection) which get data from ListA.I want to get the ID's of all the selections in the lookupcolumn in ListB and based on these ID's i want to update back the items in ListA based to these ID's.

As soon as some one selects the lookup values in multiple lookup field each selected value in the lookup is coming from an item in the source list so when they save the item the values of the lookups corresponding items in the source list has a status column whose status needs to be changed from available to Locked.

Suppose in ListA i have lookupcolumn status

                                         val1                 Available

                                        val2                  Available  

                                         val3                Available

                                          val4               Available

In ListB if i select Val1;Val3;Val4  and save the item i need to update the status of Val1;Val3;Val4 to Locked.

Userlevel 7
Badge +17

If you query the lookup field you should receive data structured in a JSON format, have you tried that? You need then to parse that JSON and get IDs of lookup elements. After do a "for each" loop to update relevant item on the source list using the obtained ID.

Regards,

Tomasz

Userlevel 5
Badge +14

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.

Userlevel 7
Badge +17

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 silly.png), nevertheless it is "querable" and certainly will return something to process.

Regards,

Tomasz

Userlevel 5
Badge +14

‌, 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...

Badge +3

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.

Userlevel 7
Badge +17

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?

Userlevel 5
Badge +14

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.

Badge +3

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.

Badge +3

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.

Userlevel 7
Badge +17

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. 

200877_pastedImage_2.png

200878_pastedImage_3.png

  • 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":

200879_pastedImage_5.png

  • 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:

200880_pastedImage_6.png

  • That way set your "Status" column value.

In total this workflow should look like this:

200881_pastedImage_7.png

Regards,

Tomasz

Badge +3

Hi Tomasz,

Thanks a ton for the help.

Badge +3

Hi Tomasz,

I do not have the advanced lookup in regular expression

Userlevel 7
Badge +17

There is no way you don't have such function. Look carefully happy.png

Regards,

Tomasz

Badge +3

You are awsome happy.png got it resolved and you saved my next weekend happy.png.

i have one last issue. I have two lookup fields one lookup is dropdown and another is multip-selection. based on the lookupdropdown selection i would like to filter values in multiple selection.

Userlevel 7
Badge +17

Post it please as a separate question. Do not create off topics happy.png

Regards,

Tomasz

P.S.

Please mark the most helpful answer as correct so that others will know this problem has its solution happy.png

Userlevel 6
Badge +15

See, ‌ - workflow avengers to the rescue! ;D

Thanks ‌!

Badge +2

Hi Dileep,

Can you please let me know where can i find this "Advanced LookUp" action ?

Reply