Help with loop -


I currently have a process that Connects to a db, Runs a query, and builds a datatable. Two fields in the datatable output need to set variables inside a loop.

Can someone help me select the appropriate loop and set the variables? Each row in the datatable is setting the variables.



Hi tim,
Please check the image below:

Hope it helps you!

Hey @timothy.mullady
Here’s a simplified visual representation of workflow :

  • Database ConnectConnect to your DB
  • Execute QueryStore results in dtResults
  • For Each Row in DataTable (dtResults)
    • Assign (variable1 = row("FirstColumnName").ToString)
    • Assign (variable2 = row("SecondColumnName").ToString)


You don’t need to set variables. Just use CurrentRow(“ColumnName”).ToString to get the values inside the loop (For Each Row in Data Table).

The query activity returns a datatable, you don’t have to build the datatable.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.