I'm trying to pass an HTTP Post Request with a data pill in the Request body, but it is throwing an error because of an invalid request body. When I look at the output, it seems that the quotes in my data pill is breaking it. How do I escape the quotes?
Best Answer
P
Patricia Guevarra
said
over 6 years ago
Hi Saul!
You can escape quotes using the gsub formula. Please try the following:
Just substitute the Message pill for the relevant pill. It would be best to log this formula in a message or in the List app before you map it in the Request Body so that you don't have to worry about using formula mode in the Request Body.
For your reference, this formula is telling the recipe to search for double quotes in the data pill value, then substitute it for \" to escape the quotes. It would be best to use single quotes to surround the \" so we don't confuse the recipe.
I hope this works! Let us know if you need further assistance.
Answer
Patricia Guevarra
said
over 6 years ago
Hi Saul!
You can escape quotes using the gsub formula. Please try the following:
Just substitute the Message pill for the relevant pill. It would be best to log this formula in a message or in the List app before you map it in the Request Body so that you don't have to worry about using formula mode in the Request Body.
For your reference, this formula is telling the recipe to search for double quotes in the data pill value, then substitute it for \" to escape the quotes. It would be best to use single quotes to surround the \" so we don't confuse the recipe.
I hope this works! Let us know if you need further assistance.
Saul Macht
Escaping double quotes in a pill
I'm trying to pass an HTTP Post Request with a data pill in the Request body, but it is throwing an error because of an invalid request body. When I look at the output, it seems that the quotes in my data pill is breaking it. How do I escape the quotes?
You can escape quotes using the gsub formula. Please try the following:
Just substitute the Message pill for the relevant pill. It would be best to log this formula in a message or in the List app before you map it in the Request Body so that you don't have to worry about using formula mode in the Request Body.
For your reference, this formula is telling the recipe to search for double quotes in the data pill value, then substitute it for \" to escape the quotes. It would be best to use single quotes to surround the \" so we don't confuse the recipe.
I hope this works! Let us know if you need further assistance.
Patricia Guevarra
You can escape quotes using the gsub formula. Please try the following:
Just substitute the Message pill for the relevant pill. It would be best to log this formula in a message or in the List app before you map it in the Request Body so that you don't have to worry about using formula mode in the Request Body.
For your reference, this formula is telling the recipe to search for double quotes in the data pill value, then substitute it for \" to escape the quotes. It would be best to use single quotes to surround the \" so we don't confuse the recipe.
I hope this works! Let us know if you need further assistance.