โ06-28-2022 10:43 AM
Hi,
How I can use an expression to read the below in a mapper to get individual values true or false? I am using as - $DocumentId.startsWith(โEBSPERSON_โ)
[
{
"Content_ID":
"EBSPERSON_547229"
}
{
"Content_ID":
"EBSPERSONAD_547229"
}
{
"Content_ID":
"EBSPHONE_547229"
}
]
โ06-28-2022 08:13 PM
@amit.saroha
Hope this helps
jsonPath($, "$[?(value.Document_ID.startsWith('EBSPERSON_'))].Document_ID")
The idea is to use the filter operator. It will select all the element/s in the Array that match the given expression. In the above example, my filter condition is based on the value of โDocument_IDโ
โ06-29-2022 07:20 AM
@Dheeraj - Thank you for all the help but I am still facing the issue. I think itโs not JSON in Document_ID but it is string (see screenshot # 2). Could you suggest how to overcome it?
h
โ06-29-2022 09:12 AM
@amit.saroha
Would you be able to download and share the preview of the upstream snap connected to the mapper snap(labeled
โPerson Fileโ) shared in the screenshot above
โ06-29-2022 09:19 AM
Thank you, @Dheeraj for your help.
I have uploaded the output of the previous 3 snaps.
Mapper1_output0 (1).json (144 Bytes)
JSON_Splitter output0.json (1.3 KB)
Call_getIntegrationContentId output0.json (3.4 KB)
โ06-29-2022 09:33 AM
Thanks, Amit
If i understand your requirement, you are trying to get the highlighted section from the below API response
So, your output from the mapper should be โEBSPERSON_550542โ right ?