Copy link to clipboard
Copied
Is there a way to convert a data value from what's in the incoming JSON to another value. I've got a UI that has radio buttons on it. The JSON submission looks like:
{
Remember that the Tagger helps you design your document, but isn't actually used in a production application. You'll be using your Word template, your data, and calls to the API (normally via the SDK).
Before you call the API, you can manipulate your data as you see fit. So if you got that data above from a database, you would simply use code to change the 1 to Yes, and 0 to No.
In other words - get your data as you normally would - modify the data - call the API.
Copy link to clipboard
Copied
Remember that the Tagger helps you design your document, but isn't actually used in a production application. You'll be using your Word template, your data, and calls to the API (normally via the SDK).
Before you call the API, you can manipulate your data as you see fit. So if you got that data above from a database, you would simply use code to change the 1 to Yes, and 0 to No.
In other words - get your data as you normally would - modify the data - call the API.
Copy link to clipboard
Copied
I was hoping not to add a data manipulation step and instead handle it in the Word template, but fair enough. Thanks for the response.
Copy link to clipboard
Copied
One thing to keep in mind (and note, I'm cfjedimaster, I must have logged in with my nonwork user), is that template languages in general draw a line between how much can be done in the language and how much should be done in code. Handlebars, for example, is very strict. If I remember right, you can't do stuff like, "if name == ray" but must instead ensure you've got booleans setup ("if ray"). The idea being that Handlebars doesn't want you building complex templates.
This is all philosophical, but I thought I'd share. 🙂 I prefer Liquid which lets you do quite a bit, but even it has it's limits.