kunalpatel
Collaborator

Re: Send email to each user using For Each Loop

Jump to solution

@bimi82 that's correct. In my approach you query the list only once and store values you need in collection and then you manipulate collection variables to get what you need. 

 

In your solution, you first query the list and then inside for loop you query the same list multiple times.

0 Kudos
Reply
bimi82
Contributor

Re: Send email to each user using For Each Loop

Jump to solution

@kunalpatel hmm intresting and is there a statement from Nintex to confirm your statement?

As per your solution: imagine if I had 20 variables holding information then I would need 20 x collection operation to get the result from the num_index??

0 Kudos
Reply
kunalpatel
Collaborator

Re: Send email to each user using For Each Loop

Jump to solution

@bimi82 ...you can either open a case with Nintex support or do some research but the reason I gave is my understanding on how each action works. Each time you run query list that means based on the parameter you've provided in the action it's going to query the SQL table to get the information, so do your math, querying SQL once will use more resource or querying same table multiple times ?

 

Also yes, you'll have to create the 40 variables (20 for collections and 20 for storing individual values). If you think spending time in creating these variables weighs less than querying SQL multiple times then please create the solution which you think best. 

 

If I've to create this solution then I'll go with collection variables, I'll put these collection operations in an action set or run parallel and collapse the action. Also before entering to next action, I'll put commit pending changes, just to make sure each collection operations have been completed.

Reply