how do I change the input value within JSON in the request body
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2022
07:34 PM
01-18-2022
07:34 PM
how do I change the input value within JSON in the request body
I want to modify the values within JSON in the request body. Here's an example of the request body
{ "driverId": "${userInfo#Respoinse#$id},
"otherDetails" : "${driverDetails#Response#$details}"
}
I want to reverse the string value of parameter otherDetails.
I have tried a few combinations and none of them works
- ${driverDetails#Response#$details.reverse()}
- ${driverDetails#Response#$details}.toString().reverse()
- $({driverDetails#Response#$details}).reverse()
- ${${driverDetails#Response#details}.reverse()}
Appreciate some help here.
How do I reverse the string value within the ${ } or there are other ways to do that?
Solved! Go to Solution.
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022
05:55 AM
01-19-2022
05:55 AM
We need to use ${=} to execute the Groovy code. And inside the code we can use the SoapUI property.
An example:
${="${#TestCase#petName}".reverse()}
Please note that the quotes make a string object, otherwise it would be treated as an identifier.
Best regards,
Karel
Karel@apimate.eu
https://apimate.eu
https://apimate.eu
