https://linen.dev logo
#help
Title
# help
j

Jobaer Ahamed

07/19/2023, 3:19 PM
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

Tom

07/19/2023, 5:26 PM
Hi @Jobaer Ahamed you need to remove the quotes (and you can simplify the expression a bit too):
"id": {{request.path.4}}
❤️ 1
j

Jobaer Ahamed

07/20/2023, 9:56 AM
Hi, Thank you! I am using json mapping so using without the quotes give error. and using jsonBody.
t

Tom

07/20/2023, 11:34 AM
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

Jobaer Ahamed

07/20/2023, 12:59 PM
Thanks @Tom.