I want to pass a quotation mark into JSON but the escape methods I'm using don't appear to be working. How do you pass a strong into JSON with a quotation mark?
[
{ "attributes": { "OBJECTID": 307, "Comments": "This is a test "with quotes"" } }
]
Thanks for the info. Just included some clarification below.
The screenshot I included above was a sample of a longer JSON string that I created, but I only included the problem section. When I put the entire JSON string through the JSON validator it tells me its valid.
This is a look at what the JSON would be when sending to REST.
{
"attributes": {
"OBJECTID": 15,
"Comments": "This is a test"
}
This push to REST continues to work for other points (in the same service) and has worked fully in the past. I am hitting the apply edits function of REST so hence the reason for updates. Would features be better option?
I would like the user to have the option to enter double quotes or not enter them without causing issues to JSON syntax either way.
The text appearing in the "Value" window doesn't look like well formed JSON. It looks like it is a paste inside a previous paste. If you want "feature" inside the window, it should be in quotes as should "attributes" along with some commas in there. I would also suspect that the Name should be "features" not "updates". I must admit, however, that I am not very familiar with Integromat. To check your JSON, try jsonlint.
Already have Integromat set to RAW body type
If escaping isn't working, I would try raw string formatting or triple-quoted literals.
It might be worth reviewing 2.4.1 String and Bytes literals, 2. Lexical Analysis -- Python 3.6.
Didn't work. I'm using Integromat push this JSON. Integromat has dynamic data modules that are passed in...don't know if this is causing the issue.
Also, not every time the user will enter quotes in the text box.
I would try \" :
[ { "attributes": { "OBJECTID": 307, "Comments": "This is a test \"with quotes\"" } } ] <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.