List query only returning last item in collection. Any ideas how to return all items in collection and display aesthetically in an email?
I think we'll need some more information than this. What does your list look like, are you querying a single column, what is the column type?
If, for example, the column is a "single line of text" type, and your query drops (potentially) multiple matches into a collection variable, then I think you could either-
That is exactly the case. The only thing is I am returning multiple columns that have multiple matches stored into collection variables. Do you still feel the latter of your suggestions is the best option?
Yes, in that cased I think you'd need to use a loop.
Imagine you have (say) two columns in your list- Name and Address
You now have a chunk of html representing your entries in a table that you can emit into whatever target, say an email.
I actually am returning 6 columns, but for simplicity let's stick with your example. Currently I am trying to do nested for each loops on each individual collection but I like your solution better. Could you go into more detail on how I can loop over one collection but return the same index from another. I.E How do I loop over Selected Name[i] and return Selected Address[i] and perhaps Selected City[i], in nintex?
I think I figured it out. I just did a for each on one collection then did a bunch of collection operations (pops) on the other collections returned in my list query. Think this should do the trick.
You can access the other column items though pop or get[index]
As I said, the one time this could fail is if not every item has a value in every column. I'm not sure if Nintex will give you back an empty string (say) representing the empty field value, or whether you'll end up with one collection having fewer items in it than the others. That would mean your collections get out of sync with each other.
To fix that I think you'd have to query the list for a set if IDs that match the rows you want (every row always has an ID), then in the loop go back and query for the column values by looking up based on the row ID.
I just tested this. It seems to insert a null or empty string for the blank field value, so the collections stay in step with each other, and a simple loop works. For once life is good ;-)
Retrieving data ...