I’m trying to write JSON to a text column in the GT using the HTTP module in Make.
Instead of the module parse it and send it to different columns I want to try and send the whole JSON back and then I use query JSON columns to extract what I need.
However I think i’m running into an issue where the Glide API is getting an ‘unexpected token’ which occurs at the start of the JSON i’m trying to pass. My guess is that it’s interpreting it as part of the JSON instead of a value string?
When I look at the request content on the HTTP module after the call the data looks like this:
"columnValues": {
"BFEgI": "/{"response":true,"msg":"appointment created successfully","data":{"appointment":{"key":"a2762f50e1696e9833f68e8c009c366898e6d2d4","start_time":"2023-12-21T14:00Z","end_time":"2023-12-21T14:30Z","duration":30,"staff_key":"9ZiX6zYRYb6YjVwU361TdQsx5DmVDthF","service_key":"fc5dc4e4-9e54-4d6d-ba64-9c07dcd9ffac","customer_key":"c97b080ddf0f5dc43ebfdf56d4cc07be417737be1","cost":0.0,"currency":"QAR"}}}/"
},
“BFEgI” is the column ID and the rest is what was sent as the value, which looks to be escaped at the beginning and end, does more work need to be done to get it where I need it?
Yes.
Double quotes are reserved characters in JSON, so if you want to send a JSON string that includes double-quotes, then every one of them needs to be escaped.
You would need something like the following:
"columnValues": {
"BFEgI": "{\"respone\":true,\"msg\":\"appointment created successfully\",\"data\":{\"appointment\":{\"key\":\"a2762f50e1696e9833f68e8c009c366898e6d2d4\",\"start_time\":\"2023-12-21T14:00Z\",\"end_time\":\"2023-12-21T14:30Z\",\"duration\":30,\"staff_key\":\"9ZiX6zYRYb6YjVwU361TdQsx5DmVDthF\",\"service_key\":\"fc5dc4e4-9e54-4d6d-ba64-9c07dcd9ffac\",\"customer_key\":\"c97b080ddf0f5dc43ebfdf56d4cc07be417737be1\",\"cost\":0.0,\"currency\":\"QAR\"}}}"
}
I would recommend using the Create JSON module to prepare the JSON string.
Add a Create JSON module after your HTTP module. The JSON module will ask you to select a Data Structure. Use the Generate option and paste the JSON from the curl Add example you get from Glide.
Save that and add a mutation, and select the output of the HTTP module for the BFEgI column value.
Then use the output of the JSON module for the Data section of your subsequent HTTP module.
It looks like I have step 1 and 3 down. But step 2 I cannot find ‘mutation’ inside the create JSON module. I have just input the variables from the parsed HTTP output:
No, that’s not right. The Data Structure you need to create should reflect what Glide expects.
So when generating the Data Structure, you need to copy/paste the JSON that Glide gives you. It should look something like this:
How would I configure the create JSON module to output only the value that I want and not the whole payload that Glide expects, for the purposes of mapping it to the new Glide Make.com module?