Of course. Silly me. I misunderstood your second post.
Taking a closer look at your formatting, these are pre-processing templates so you still need the follow the rules just as if this was PDF doc generation template.
The IF needs to have an “endif” and the START needs to have an “end”. Links below to articles for examples.
***************************************
Unfortunately, after reading another thread (here) I think you might still have an issue UNLESS the problem of the extra column after an “endif” was resolved. You may want to try it out anyway.
There was this comment:
”Just FYI for anyone finding this thread, I raised the issue with Appsheet support, who gave the solution of replacing <><> with an Appsheet If() expression. This worked in my case of a webhook posting a JSON Payload to an external API, so just sharing here in case it helps others.”
It sounds like the person was able to use a REGULAR If expression instead of a template based one.
****************************************
Once you have that format sorted out, I understand that you are partly using the IF to decide if a comma is inserted or not. But I would suggest something more like this:
…
<<If:COUNT([Related CAD])=0>>
“date_du_devis”: “<<[date]>>”
<<endif>>
<<If:COUNT([Related CAD])>0>>
“date_du_devis”: “<<[date]>>”,
“publicitesCAD”: [
<<Start: [Related CAD]>>{
“numero”: “<<[id].[numero]>>”,
“date”: “<<[id].[sortie]>>”,
“format”: “[id].[format]”
…
<<End>>
<<EndIf>>
Use If expressions in templates
Use Start expressions in templates
I hope this helps better!!