How to get rid of the curly brackets when using the expression $ {}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022
12:24 AM
06-28-2022
12:24 AM
How to get rid of the curly brackets when using the expression $ {}
Hi Community
When I use the ${} expression, i.e. ${GetChangedActiveJobIds#Response}, the raw request is { {"Ids":[306, 360]}} on the Custom Properties. How do I get rid of the outer curly brackets? what expression can I use?
I need to pass {"Ids" : [306, 360]} to the API.
Labels:
- Labels:
-
REST
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2022
04:10 AM
07-03-2022
04:10 AM
{ {"Ids":[306, 360]}} -- this looks invalid json. see if the response is returning invalid json
expected Response:-
{
"id": 1,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": ["string"],
"tags": [ {
"id": 0,
"name": "string"
}],
"status": "available"
}
GroovyScript :-
def res = context.expand('${Req#Response}')
log.info res
Above GrooryScript returns below as response with adding extra curly braces
