Extract variable policy- extract json array as string

Not applicable

is it possible to extract a variable and then manipulate it?

i am trying to extract JSON array but as tring..

tried configuring type as string but didnt help

    <JSONPayload>
        <Variable name="details" type="string">
            <JSONPath>$.details</JSONPath>
        </Variable>
    </JSONPayload>
0 6 1,584
6 REPLIES 6

HI @yuri abaev

Please use nodeset as type instead of string. More info here

<JSONPayload>
        <Variable name="details" type="nodeset">
            <JSONPath>$.details</JSONPath>
        </Variable>
    </JSONPayload>

The JSON array is stored in details variable. If you further want to manipulate, you can using Javascript policy

Hope this helps !

@Sai Saran Vaidyanathanwhere can i find information about nodeset?
and why do i need to use this ?

Hi @yuri abaev - Apologies for missing the link. Updated my earlier post with the link

@Sai Saran Vaidyanathanthanks for the link,as I understand nodeset simply returns a json right?
I've extraced the var with no type attribute, and yet got a json, do i get it wrong?

Yes - you get the object when you use nodeset. I would recommend you to use the type="nodeset"

If this answered your question, please accept the answer for others

Hi @yuri abaev - Did this answer all your question, if yes, please accept the answer