Forum Discussion
Hi @Sahil,
You can use mapping to do this. Here is an example:
jsonPath($, “$Z_RDGD102.IDOC.DKA1[*].PAR”).map(x=>x == “AF” || x == “AG” || x == “PC”).toString()
Or, if you have multiple PAR objects in DKA1, and at least one should match the condition, than you can go with this:
$Z_RDGD102.IDOC.DKA1.filter(x=> x.PAR == “AG” || x.PAR == “AF” || x.PAR == “PC”).length>0
Regards,
Bojan
Hi,
I tried 1st option but I am getting below error:-
Failure: Unable to write to JSON-Path: $.Order.Data.Addresses, Reason: Expecting object or array for wildcard path, found: true,false,true,true,false,true, Resolution: Change the preceding path to refer to an object or array value- bojanvelevski5 years agoValued Contributor
As I said @Sahil, if you have multiple PAR objects, you need to go with the second expression. The expression is a boolean, if only one of the repeatable segments is AF,AG or PC , than you’ll have True.