Nintex Workflow for Office 365 – How to get the corresponding values of a lookup column value

janvonreith
Nintex Newbie
1 5 1,800

In my scenario, I have two lists. The first list is called „Car marks and Product locations“, where I store car marks and the locations where they are produced.

image

The second list is called „Car marks“, there I can create entries and choose between different car marks via a lookup column on my first list. The corresponding locations for the chosen car marks should automatically be stored in an additional column called „Product locations“.

image

The workflow that identifies the corresponding values looks like this:

First I use a „Set variable“ action to get the ID’s of the values that have been chosen in the lookup column „Car marks“ and store them in a variable called „varCarMarksLookupIDs“.

image

At this point it’s important to mention that I choose „Lookup IDs, Comma Delimited“ as the format for the values I store in the variable.

image

Then I use a „Regular expression“ action to split the single IDs and put them into a collection variable called „vCarMarksLookupIDsCollection“.

image

Now I’m using a „For each“ action to iterate through all ID’s that have been stored in the collection. The current ID always gets stored in a variable called „vCarMarkSingleLookupID“.

image

In the first step of the „For each“ action I get the product locations for the current car mark ID and store them in a variable called „vCarMarkProductLocations“ with the help of a „Set variable“ action.

image

In the second step of the „For each“ action I build a continuous string of all product locations with the help of the „Build string“ action.

The variable „vCarMarksProductLocationsAll“ contains all product locations. For every loop, I add the corresponding product locations for the current ID to that string.

clip_image016

At the end of the „For each“ action I have all corresponding product locations for every car mark in my string variable and can now update the item with it.

image

This is how the whole workflow looks at the end:

clip_image019

And this is the result after the run of the workflow:

image

You can find the workflow in the attachments 😉

5 Comments
jaapsteenis
Nintex Newbie

Thanks Jan for the very good in-depth blog post. I will give it a test soon and let you know the outcome.

Best regards

Jaap

jaapsteenis
Nintex Newbie

Hi Jan, I am building the flow and missing some information regarding the variables used.

Noticed you are using for example var vIndex (that's required)

If you can list the variables and types used that would be helpful.

I am currently having an output very near 🙂  in the product locations column below.

If possible, can you attach the workflow Jan?

Thanks

Jaap

janvonreith
Nintex Newbie

Hey Jaap Steenis‌,

make sure you get this point:

Nevertheless I also attached the workflow to the blog post 😉

Best regards,

Jan

eiben
Design Canvas Artiste

Just being a nitpicker - the vIndex is not required

jaapsteenis
Nintex Newbie

Thanks Jan for the super support, can you send me a pm with your address so I can send some Gouda sweets over the line ? 🙂