cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I have a groovy script below to parse an incoming JSON message to extract values and store as properties.

I want to use these property values in the content modifier for a JSON payload to an external system.

The output properties have the following format:

But I need only the values eg. Hyderabad without the square brackets.

How do I remove the brackets in the output message in the Groovy script?

Or can I do this in the Content Modifier?

Thank you.

Best Regards,

Lorna

0 Likes
View Entire Topic
kc_kristris
Active Participant
0 Likes

Hello Lorna,

Before setting up properties remove the square brackets.

text = text.replaceAll("[]", "");

Regards,

Kris

0 Likes

Hi Kris,

Thanks for your reply.

I need to remove the brackets after the properties to map the JSON input to a JSON output.

The JSON output will be used as input to call another API service.

After the groovy script, I used a content modifier.

In the body I added in the JSON output with the $(property.BillingCity} but it brings in the square brackets as below:

I want to remove the square brackets from the property values.

Is this possible?

Thanks.

Best Regards,

Lorna