I have several checkboxes (Boolean) in my entity. When I create a PDF-template the values are output as "True" and "False". Is it possible to convert the output as "Yes" and "No".
Output of field in PDF print
Collapse
X
-
Meanwhile I succeded in resolving this. My tip for anybody searching for syntax, you have to search for "handlebars syntax", because templating in EspoCRM is provided by handlebars.js.
As I am not a programmer I had to try lots of possibilities. Boolean values you can output via an if-condition. This condition does not allow expressions but only single values. First I thought, I would have to insert not only the field-name, but also the state (true/false or 1/0), but this did not work. I think this is, because a Boolean "is" or "is not", what means, when the checkbox is not clicked, this is already the state "is not". Because of this, you do not need an additional condition.
Ok, so far my simple concluded explanation. The code to format the Boolean output has to look like the following:
{{#if name}}
Yes
{{else}}
No
{{/if}}
where "name" is the name of the respective field.
Simple as that. I hope this will help others with similar problem. -
-
Comment