I’m trying to send a set of error codes to an integration endpoint. In the interest of being conservative about data volume at scale I was attempting to only send error codes which exist rather than a binary state for every error code. I have tried the following format in a number of shapes, but I consistently get this parse error. Any ideas what I’m overlooking?
You latest version is really close, but I think you still need the dummy item at the end of the “d” object. Otherwise, if there is a p element, there will be a trailing comma, which will cause an error.
ScruffR is correct. The {{#if x}} syntax is not supported but you can make your case work using {{#x}} which is how I do conditionals in the Google maps device locator.
@rickkas7, but why does console integrations complain as shown in my screenshot above at line 4 (and when removing the condition from that line the red X jumps to the next line)?
Even if the string is acceptable for the backend, the editor should not flag that.
Also the editor is rather annoying with the misalignment between editing position and the carret.
It’s because when you use the Custom Template in the integration, it’s setting the json key, not the body key, and it must be valid JSON without mustache parsing, which line 4 is not.
When you use the CLI to set the body key, mustache parsing is applied. Interestingly, if you then edit it with the GUI you get a different presentation that does not parse it as JSON and it’s just one text block with no syntax checking.
So it may be advisable to first check the validity with a third party tool and then copy/paste the valid handlebars expression into the body element like here
This is a valid workaround for simple webhooks. The Azure integration only allows JSON and will not allow me to save with the syntax it finds to be invalid. Any options there?