I know the action 'list query' which creates a collection of items.
I want to query my current item on some aspects (for example: all empty properties). Is that possible? Maybe through a workaround..
I want a collection of all fields from my item that are empty. Any ideas?
Solved! Go to Solution.
There might be a smarter way of doing it (especially for a list with loads of columns) but you could create a collection containing the names of each of your columns, run a for each on this collection and query the current item to see if that field is empty (or whatever you want to query for) and if it is add the name (stored in a variable from your for each) to another collection. If it isn't empty then just move onto the next one.
You should end up with a collection of all the field names that have no value in your current item.
Thanks for your answer!
But for creating a collection in the first place I would have to add every single property to the collection? WIth 15 columns I would have to add 15 workflow actions right? :/ I don't like that it isn't possible to add more than one variable to a collection at one time..
I did say it wasn't pretty
The GetListsandView method in the lists.asmx web service can return the schema for the list. This would allow you to get all the columns into the collection in an automated way. It would also cater for any new columns added to the list in the future without you changing the workflow.
In your first answer you said I should create a collection with all the column names and then query the current item to see if that field is empty? How would I achieve the second part?
I think you'd need to use the Query Builder to put your variable as the name of the column you'd like to assess and then assess if that field is empty for the current item. Afraid I have no Nintex access at the moment to be able to illustrate this. Does this help? If not, maybe someone could pick up the baton to demonstrate a way of doing this.
the other idea might be that you create calculated field on a list out of fields you need to check. separate single fields by a separator.
that way you will query just one field from the list.
then regular expression action will become your friend.
- either setup a pattern that identifies two or more subsequent separators
- or split read in value into collection by the separator. loop through collection and check single elements for emptiness. if you find at least one, you know you have to take care of the item. if you know what's sequence of original list fields, you can as well identify which one is empty