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

Need help with Collection variable

Jump to solution

I used a Query List action to get Titles for all items in the list and saved it in a Collection variable. Next I want to do the For Each action and compare the title to items in the different list. It all works as expected on-prem but there is something different with the Collection variable in O365. Here is my Collection variable:

[{"Title":"12-2812"},{"Title":"12-2816"},{"Title":"12-2817"},{"Title":"12-2818"},{"Title":"12-2819"},{"Title":"12-2820"},{"Title":"12-2821"},{"Title":"12-2822"},{"Title":"12-2823"},{"Title":"12-2824"}]

Once I run For Each it seems to return "Title":"12-2812" instead of just 12-2812. How do I get just a value from a collection variable to compare to another list?

Labels: (1)
0 Kudos
Reply
6 Replies
Workflow Hero

Re: Need help with Collection variable

Jump to solution

Hi Igor,

This guide here https://help.nintex.com/en-US/O365/Default.htm#o365/O365WorkFlow/GettingtoknowNWO/ForEach-CreateWork...  suggests that it should return both the key and the value in different fields (one output for key, one output for value). Which are you logging to get the value there?

Callum

0 Kudos
Reply
Workflow Hero

Re: Need help with Collection variable

Jump to solution

The link talks about a Dictionary variable. Should I be using it instead of the Collection variable for my scenario? I will do some testing to see if it works as expected.

0 Kudos
Reply
Workflow Hero

Re: Need help with Collection variable

Jump to solution

Hi Igor,

Sorry I completely missed that from your original post, however this may be the issue. A Dictionary is comprised of one or more key/value pairs (as your data is), where as a collection is just a collection of items. If you were to use a dictionary variable in this instance, I think it's likely that the For Each should split the key "Title" away from the value "12-2812"

Let me know how you go.

Thanks,

Callum

0 Kudos
Reply
Workflow Hero

Re: Need help with Collection variable

Jump to solution

When using the Query List action in Nintex for O365 the output can only be saved in the Collection variable. So we are back to square one - how do I extract a value from a Collection variable?

0 Kudos
Reply
Workflow Hero

Re: Need help with Collection variable

Jump to solution

So when everything else fails - read the instructions... In O365 there is an option to save output separately for each column. Once you select it everything works as expected!

Reply
Workflow Hero

Re: Need help with Collection variable

Jump to solution

Glad you found the answer, sorry for the misleading dictionary conversation.

Callum

0 Kudos
Reply