07-08-2023 02:05 AM
Hi,
I have one requirement in this there is one API return list of values comma separated and Another column coming from Snowflake and I need to compare and generate a flag
Note : order of strings are not fixed
Example Column1: [‘STRING1’,‘STRING2’,‘STRING3’,‘STRING4’]
Column2: [‘STRING1’,‘STRING2’,‘STRING3’,‘STRING4’]
07-08-2023 12:48 PM
Hello @Rahul,
You can compare the two list by first merging them using the Join Snap. Then, using the following expression in a Mapper Snap to compare the lists:
$api_list.length == $snowflake_list.length ? ($api_list.filter(x => $snowflake_list.indexOf(x) != -1).length == $api_list.length) : false
Here is a sample pipeline:
–sl-comm-compare-lists_2023_07_08.slp (6.6 KB)
Let me know if this is of any help. 🙂
Regards,
Aleksandar.
11-20-2023 12:04 AM - edited 11-20-2023 12:15 AM
@Aleksandar_A - Can you please share the sample pipeline as I am getting Page not found error
11-20-2023 03:30 AM
11-20-2023 05:56 AM
Thank you @Aleksandar_A
Also, Is there a way to easily show what key values do not match between two JSON objects?