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 ?