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
Request clarification before answering.
Hello Lorna,
Before setting up properties remove the square brackets.
text = text.replaceAll("[]", "");Regards,
Kris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.