Skip to main content
Nintex Community Menu Bar
Solved

How do we get all results (sql query) to be stored in a variable so that we can later use that variable to send out an email to multiple email addresses?

  • October 9, 2024
  • 3 replies
  • 85 views

kpope
Forum|alt.badge.img+7

How do we get all results to be stored in a variable so that we can later use that variable to send out an email to multiple email addresses?

In a Site WF running daily

There are multiple Sql Queries configured the same (just on different views in db) pulling back multiple email (contacts) Storing in a collection variable - in the WF History, we can see only one email address is being stored (there should be several) 

When testing the query in the wf, we get multiple results - SQL Query is a success

we want the collection variable to take each email address and separate it by a comma or a semicolon - for emailing purposes. 

Best answer by kpope

recap:

this is a site wf run on a schedule

we were using a collection variable, the results were in a table, not in a single column.  Nintex doesn’t support results in a table. 

so we created a storedproc to return all the email contacts needed per item, per criteria, in a column.  

This worked successfully to simply use these variables in the email TO line. no issues. This is MUCH simpler and efficient than what I had previously designed. 

 

3 replies

SimonMuntz
Nintex Employee
Forum|alt.badge.img+23
  • Nintex Employee
  • October 10, 2024

Hi, @kpope,

Make sure you are using a Collection Variable and not a single line of sext variable in the Execute SQL action. My testing showed that a collection will return all rows but a a SLT will only return the first row.


MillaZ
Nintex Employee
Forum|alt.badge.img+22
  • Nintex Employee
  • October 14, 2024

Hi @kpope 
Have you solved your question? 


kpope
Forum|alt.badge.img+7
  • Author
  • Apprentice
  • Answer
  • October 14, 2024

recap:

this is a site wf run on a schedule

we were using a collection variable, the results were in a table, not in a single column.  Nintex doesn’t support results in a table. 

so we created a storedproc to return all the email contacts needed per item, per criteria, in a column.  

This worked successfully to simply use these variables in the email TO line. no issues. This is MUCH simpler and efficient than what I had previously designed.