Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Not able to extract values from json response

Not applicable

Hi,

I know there are few question related to this but it's more specific to my json response.

My json response is like below:

[{"input":"ascii","ascii":"google.com","unicode":"google.com","unicodeLabels":["google","com"],"codePoints":[["U+0067","U+006F","U+006F","U+0067","U+006C","U+0065"],["U+0063","U+006F","U+006D"]],"scripts":[["Latin","Latin","Latin","Latin","Latin","Latin"],["Latin","Latin","Latin"]],"scriptCombination":[["Latin"],["Latin"]],"success":true}]

i want to extract 'unicode' value through extract message policy.

Here's the code:

<JSONPayload>
        <Variable name="unicode">
            <JSONPath>$[0].unicode</JSONPath>
        </Variable>
    </JSONPayload>

looks like there is some problem with my extraction pattern.

Need help !!

Solved Solved
1 7 3,393
1 ACCEPTED SOLUTION

Hi @Vinay Soni The following worked for me :

 <JSONPayload>
        <Variable name="extracted-json">
            <JSONPath>$[:1].unicode</JSONPath>
        </Variable>
    </JSONPayload>

I would also recommend to try out a jsonPath here : http://ashphy.com/JSONPathOnlineEvaluator/

Let me know if it works.

Thanks

Sarthak

View solution in original post

7 REPLIES 7