Data templates transform the data model into text or HTML content. Templates are used in many areas in emakin like form controls or mail templates etc.
...
Code Block | ||||
---|---|---|---|---|
| ||||
{{ format( 'Employee/RegistryNumber', 'string' ) }} |
By default template values are not automatically formatted but Label like controls automatically formats the number like values. You can use format string to disable auto formatting.
Examples
Template | Outputs | |
---|---|---|
{{format('1234','safe')}} | 1234 | |
{{format('<hi>hello</hi>','html')}} | <hi>hello</hi> |
Number formatting
Functions like "Sum" or "Count" already return number values, therefore there is no need for number conversions, but in case it is necessary, number() function should be used. Ex: number(MyNumberField)
...
Template | Outputs | Culture |
---|---|---|
{{ MyDate }} | 01/31/2014 16:04 | |
{{ format(MyDate,'MMM/yyyy/dd') }} | Feb.2018.04 | |
{{ format(MyDate,'MMM/yyyy/dd') }} | Şub.2018.04 | tr-TR |
{{format(MyDate, 'MMMM yyyy')}} | Nisan 2021 | tr-TR |
{{ format(MyDate) }} | 31/01/2014 09:00 | |
{{ format(MyDate) }} | 31.1.2014 09:00 | tr-TR |
{{ format(MyDate,'d') }} | 31/01/2014 | |
{{ format(MyDate,'D') }} | Monday, June 15, 2009 | en-US |
{{ format(MyDate,'o') }} | 2014-01-31T09:00:00+02:00 |
...