Hello Everyone! Can anyone help me figure out how ...
# help
j
Hello Everyone! Can anyone help me figure out how to convert a request params to int. it shows up as string
Copy code
"id": "{{request.pathSegments.[4]}}",
output:
Copy code
"id": "1234",
Expected output:
Copy code
"id": 1234,
thanks in advance.
t
Hi @Jobaer Ahamed you need to remove the quotes (and you can simplify the expression a bit too):
"id": {{request.path.4}}
❤️ 1
j
Hi, Thank you! I am using json mapping so using without the quotes give error. and using jsonBody.
t
Yeah, it’s a limitation that you can’t do this with
jsonBody
you need to put it inside a string in
body
instead.
j
Thanks @Tom.