08-07-2023 06:39 AM - edited 08-07-2023 06:49 AM
I have a JSON payload with a nested array (below). I am trying to use the filter Snap to select specific items only. Unfortunately, the expressions that I have tried have not worked - they select everything or nothing.
$myList.filter(x => x.num==1)
$myList.filter(x => x.num==1)[0].num==1
[{"myList":[{"msg":"Hello, World1","num":1,"type":"Q"},{"msg":"Hello, World2","num":2,"type":"X"},{"msg":"Hello, World3","num":3,"type":"Q"}]}]
Any help or suggestions will be very much appreciated.
Solved! Go to Solution.
08-07-2023 07:31 AM
08-10-2023 03:53 AM
Thanks @koryknick, that is certainly what I have discovered - the docs don't mention this constraint though, which is why I spent so much time trying to get it to work 😀👍🏿
I have also noticed that expressions don't work well when one or more of the ancestor nodes is an array 🤔