Forum Discussion
@Henchway Sorry I didn’t 100% understand your requirement but as per my understanding you are trying to fetch email address where public ==1 from an wd:Email_Address_Data array. If that’s the case you can try either of the below expression.
jsonPath($, “[‘wd:Email_Address_Data’][?(value[‘wd:Usage_Data’][‘@wd:Public’] == 1)][‘wd:Email_Address’]”).pop()
or
sl.ensureArray($[‘wd:Email_Address_Data’]).filter((val,index)=> val.hasPath(“[‘wd:Usage_Data’][‘@wd:Public’]”)).find((ele,index)=> ele[‘wd:Usage_Data’][‘@wd:Public’] == 1)[“wd:Email_Address”]
Hi Supratim,
thanks for the suggestion, that’s the way I’m currently doing it, however, I need to check not only ‘public’, but several other elements in different levels of the json as well as some conditional logic and that gets fairly tedious once it reaches a certain size.
Here i would like to specifically solve this with the matcher and to know whether it’s possible to output a variable which includes special characters such as a colon.
Best regards
Thomas