Skip to main content
Nintex Community Menu Bar
Answer

Need help with Collection variable

  • October 8, 2018
  • 6 replies
  • 123 views

Forum|alt.badge.img+9

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?

Best answer by igorsp

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!

6 replies

Forum|alt.badge.img+9
  • Nintex Employee
  • October 9, 2018

Hi Igor,

This guide here https://help.nintex.com/en-US/O365/Default.htm#o365/O365WorkFlow/GettingtoknowNWO/ForEach-CreateWorkflow.htm%3FTocPath%3…  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


Forum|alt.badge.img+9
  • Author
  • Scholar
  • October 9, 2018

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.


Forum|alt.badge.img+9
  • Nintex Employee
  • October 9, 2018

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


Forum|alt.badge.img+9
  • Author
  • Scholar
  • October 10, 2018

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?


Forum|alt.badge.img+9
  • Author
  • Scholar
  • Answer
  • October 10, 2018

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!


Forum|alt.badge.img+9
  • Nintex Employee
  • October 10, 2018

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

Callum