Incoming record set with multiple records, and a subset of records should be processed. The record set payload may be as a result of a query, but additional filtering is needed.
0101 Query SF Accounts performs a query of SFDC Accounts, then creates customers in NetSuite, which in turn updates the SFDC Account. An error process updates Accounts on an error condition associated with the PDF Template type.
The Accounts records have to be evaluated on a record-by-record basis, and depending on the value of a field, processed in the main success scenario, or passed to error processing.
Using a condition in a transformation allows you to evaluate each record. If the condition evaluates to true, as in this case, the record is written to the temp file. If false, it is skipped.
Specifically, values are passed to
RunScript(), which will return a string of "Error" if the lookup fails. So if the local variable "result" equals "Error", then the failure operation is run, the local variable "cond" is set to false, and the record is skipped.
For the sake of completeness of the example, this is the
RunScript() call. Of interest is the use of
ArgumentList(), which allows this script to behave as a reusable function:
Last updated: Feb 28, 2020