04-10-2024 10:26 AM
Hello,
I have a nested JSON object that I want to divide in two streams. Filtering based on if "account-allocations" is NULL/EMPTY or not. Both streams coming from the same pipeline and eventually merging.
See example:
1) JSON OBJECT
2) WHEN YOU EXPAND THE FIRST ID, YOU CAN SEE THAT FOR THIS CASE "account-allocations" is empty
3) FOR THE SECOND ID, "account-allocations" is not empty (two nested entries in this case)
I tried the Filter snap, but couldn't make it work
Thank you!
#Filter #Pipeline #FilterExpression
04-11-2024 12:39 AM
Hello @rpc1235x,
You can use the Router Snap to divide the input stream into two separate streams based on the account-allocations field.
My assumption is that we will always have the account-allocations field in the input, if not you can use the $.get("account-allocations") expression.
Please refer to the attached pipeline and let me know if this helps you!
Regards,
Aleksandar.