cancel
Showing results for 
Search instead for 
Did you mean: 

Reading JSON Format

amit_saroha
New Contributor III

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"

}

]
18 REPLIES 18

Dheeraj
Employee
Employee

@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’

image

amit_saroha
New Contributor III

@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?

image

image
h

@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

amit_saroha
New Contributor III

Thank you, @Dheeraj for your help.

I have uploaded the output of the previous 3 snaps.

image

Mapper1_output0 (1).json (144 Bytes)
JSON_Splitter output0.json (1.3 KB)
Call_getIntegrationContentId output0.json (3.4 KB)

Thanks, Amit

If i understand your requirement, you are trying to get the highlighted section from the below API response

image

So, your output from the mapper should be ‘EBSPERSON_550542’ right ?