Example: Using Mapper Action
Suppose you want to retrieve unique values from the given lists of arrays into a single array. For this use case, the workflow would consist of the following actions:
Step 1: Use the Array Operations action to concatenate two arrays (containing a few common values)
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this action, see
Array Operations.
1. In the Select Array Operation list, select Concat.
2. Under the Source Array 1 section, in the Source Array field, enter ["Anakin","Han","Leia","Rookie","R2-D2"].
3. Under the Source Array 2 section, in the Source Array field, enter ["Luke","Yoda","Obi-Wan","R2-D2","Han","Padma"].
Step 2: Use the _.uniq function in the Mapper action to filter out duplicate values
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this action, see
Mapper.
1. Click
, and select
Array.
2. Replace key1 by concat.
3. Click
to add an inline expression.
4. Click
, and then map the
Output of the
Array Operations action as an input in the code editor.
5. Click > to remove duplicate values from the array.
6. Click SAVE. Custom Function is added as an input in the Value field.
Step 3: Use the Send an Email action to send unique value list to send an email
The following steps provide details of the values that you need to specify in the action form for this specific example. For detailed steps on configuring this action, see
Send an Email.
1. In the Body Type list, select Text.
2. In the Body field, map the output of the Mapper action.
Now, when the workflow is executed, it retrieves the unique values from the given arrays, and sends it to the specified recipient.