JSON Transformer

Hello,
I would like to Transform a JSON body using JSON Transformer node. I am using the “replace” operation in the JSON Transformer Expression as:

[
{ “op”: “replace”, “path”: “/parameters/List/Number”, “value”: $${Iinteger-input}$$ }
]

But the “Number” value is not accessible to make this replaces with the integer-input, as this is within of “List”. Can someone suggest some solutions for this please?

The body of JSON is as follows:

{
“parameters”:{
“List”:[
{
“Number”:“123456”,
“Type”:“DrivingLicenseNumber”
}
],
“Model”:“Test”,
“G”:“NotSpecified”,
“NAT”:null,
“Date”:“2020-04-04”,
“DateNew”:“2021-04-29T00:00:00”
},
“Reason”:“Test”,
“ReasonText”:“Test”,
“Search”:false,
“timeOut”:60,
“consent”:true
}

Hi @gokul_malaa

Your path should be like this:

[
{ “op”: “replace”, “path”: “/parameters/List/0/Number”, “value”: $${Inew variable}$$ }
]

When I use this path, it works for me.

Best wishes
Ana

3 Likes

Thanks @ana_ved for the solution & it worked well.

Gokul

2 Likes

Interesting node. Is there a dedicated tutorial or (even better) video for this?
br

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.