Unlike other languages which supports iteration based on numerical values, say iterate 10 times, deluge supports only data driven iterators that are purely based on form data. You can iterate through all the rows in the form or through selected rows based on the given criteria.
for each <row-variable> in <formname> [criteria]
Formname - Name of the form whose data has to be iterated one by one.
Criteria - In most of the cases, you would like to conditionaly fetch the data. You can specify your criteria for fetching the form data here. It is an optional parameter.
Row-variable - This variable will hold the data for a single row corresponding to each iteration.
for each <row-variable> in <formvariable>
Formvariable : it is the name of the collection variable that contains form data.
Row-variable - this variable will hold the data for a single record corresponding to each iteration.
The Task Management application illustrates the usage of for each deluge task to iterate records in a form. The application consist of 3 forms.
In the Task management application, the task is to send mail to each staff belonging to a specific module say "Scripting". To perform this action, we have to add the deluge script to WorkFlow --> On Add --> On Success section of the Staff Details form. The sample script mentioned below will iterate through each staff record in the Staff Details form who belong to a Scripting module and send mail to their email id with the specified message.
The code mentioned above iterates through each record in the Staff Details form whose module name is “Scripting” where,
r is the name of the variable that will hold the data (Staff Name) corresponding to each iteration.
The sendmail function mentioned above is used to send an email to the staff Email Id. Here, r.Email_Id, will fetch the email id from the variable r which holds each iteration of a record.
To install the application,