sritem/sridx
Provides access to the value (sritem
) and index (sridx
) when calling a service request multiple times using the call_for_each
column.
These variables are only populated when the call_for_each
column is set, and are only accessible in the service request's lifecycle hooks and in all columns on its field mappings. They are usually used to configure field mappings when calling a service request repeatedly.
# Given
call_for_each = ["[email protected]", "[email protected]", "[email protected]"]
# First iteration
fitem ==> "[email protected]"
fidx ==> 0
# Second iteration
fitem ==> "[email protected]"
fidx ==> 1
etc...
Example usage
# Given
call_for_each = [
{"name": "Sally", "email": "[email protected]"},
{"name": "Benjamin", "email": "[email protected]"},
{"name": "David", "email": "[email protected]"}
]
# To send an email to each individual, set the following on the service request's field mapping
field: email_address
value: sritem.email
Last updated
Was this helpful?