Testing Open AI chat with your question, here’s the answer it gave :
It looks like the issue is with the way you are using quotation marks in the formula for the virtual text column. In the formula ‘“content”: “this is my content”’, the outer quotation marks are single quotes, and the inner quotation marks are double quotes. This can cause a syntax error in the webhook body, because the JSON format uses double quotes for keys and values.> > To fix this issue, you can either use double quotes for the entire formula, or you can escape the inner double quotes using a backslash
hi @SkrOYC , like you said, this is a solution, but only if you do not need a complex construction of the json body.
Imagine this situation . We manage teams and soccer players.
2 tables :Teams and Players
You have an action “Show Player’s team”. You click the action and call the Webhook to send a message to other aplicaction with all the player’s names from that team.
For example You need to construct a json body with all the players of “Barcelona Team”. It means you will need to use appsheet expressions to construct a json body text. This is my real problem.
hi @SkrOYC that is my intention ! to make the whole JSON body inside a virtual text column. But I think I have some sintax problem using the quotation marks . That is why a I started with simple appsheet string, before I atack the big problem.
Hi @Marc_Dillon I tried a [ virtual column ] with the whole json text as @SkrOYC suggest, using the double double quote and it is very extrange because when I click “Test” in the Expressions Assistant window, I see a perfect JSON string…but still doesn’t work when I put in the Webhook body the expression <<[virtual column]>>
Appsheet applies a second set of processing to your body text to make sure everything matches up to webhook standards/requirements. Like it puts slashes between everything, or something like that. I think that it’s not recognizing your column value as anything other than a simple data value, and as such it isn’t applying that second round of processing. So you might have to take that all into account and more deliberately construct the body text in your variable to exactly match how it finally needs to be, from the get go. How do you do that? I don’t know, but I’d start with a simple template, and very closely examine the exact body that comes out of Appsheet.
I understand what is my problem. I am using images columns. I was trying to send Webhooks to discord including IMAGES.
If I construct the whole JSON body as @SkrOYC said (calculated in a virtual column) , I need to use a PUBLIC URL for the images.
I tried with public images of my google bucket and it works.
I used the double double quotes as @Marc_Dillon said for the JSON string (virtual column).
Maybe there is another best solution involving the private data. I know that if I write in the Webhook body something like
“image”: { “url”: “<<[my image]>>” }
it works well and use a private data, but using concatenates with [my image] to construct the whole JSON does not work. For the public image I had to convert [my image] (private URL ) in a public URL.