Forum Discussion
$.filter(x => x.status == "Complete")It will produce new array containing only the objects where status = Complete.
You can easily use SnapGPT in such scenarios to generate expressions based on your prompts.
- Colossal83332 months agoNew Contributor II
SpiroTaleski SnapGPT had already provided me that option but it does not work.
I get this error:
- String type does not have a method named: status, found in: x.status. Perhaps you meant: substr, substring, toUpperCase, upperFirst. Resolution: Please check expression syntax and data types.
- SpiroTaleski2 months agoValued Contributor
The expression will work only if the input data is array. I guess that, in your case the data is already split before the step where the expression is put (and that's the reason why it is not working).
If your data is already split, then you can filter the records using Filter Snap with the following expression:
$status == 'Completed'So only records with status = Completed will be sent further.
Or maybe you can share the screenshots of the pipeline and the output of the snap before the expression is applied, so I will have a better understanding of the current issue.