SQL Server - For each result
SQL Server - For each result
Runs a loop over each row returned by a SQL Server: Query action. The actions inside the loop run once for every row of the result, so each record can be processed individually. Use SQL Server: Get result field inside the loop to read the values of each column.
Options
Query
Reference to the SQL Server: Query action whose results will be iterated.
Returns
Javascript code
js
actions["action-id"].currentResult // result of the current iteration (Any)
actions["action-id"].currentResultIndex // index of the current iteration (Number)
Field selection
- currentResult — result of the current loop iteration (Any)
- currentResultIndex — index of the current iteration (Number)
Rules and Conditions
- The Query field is required and must reference a SQL Server: Query action.
- The actions inside the loop run once for every returned row.
- If the query returns no results, the loop does not run.