Forum Discussion
Hi j_angelevski , I have mapper snap where I am getting data as below, after mapper snap I need route it to insert into a table in postgres db or send error message...
Mapping table
Expression - Target Path
[a,b,c,d] - Original list
[a,b] - $Input list
123 - $External Id
From above mapper i need to compare input list to the original list and route it accordingly.Original list is a Hard-coded value in the mapper and I am getting lists and External IDs from a file.Thanks for your inputs
From above i need campare
j_angelevski
2 years agoContributor III
In this case you can amend the original expression.
$['Input list'].map(val => $['Original list'].indexOf(val)).filter(val => val == -1).length > 0 ? false : true
This will return true only if all values within the Input list exist in the Original list.
Output:
You can route the data based on the insert field.