Documentation
  • Welcome to Documentero Docs
  • General
    • Usage Limits and Quotas
    • Manage Account & Plans
    • Documentero Roadmap / Changelog
    • Privacy Policy
    • Frequently Asked Questions
  • templates
    • Templates Introduction & Tutorial
    • Template Upload/Re-upload
    • Organize Templates into Folders
    • Fields
    • Fields - Images
    • Fields - QRCodes
    • Fields - Links
    • Fields - HTML Support
    • Fields - Markdown Support
    • Fields - Mermaid Support
    • Fields - Formatters
    • Sections
    • Sections - Types & Options
    • Smart Fields
    • Smart Sections
    • Template Variables
  • Charts & Diagrams
  • Forms
    • Create Documents using Form
    • How to customize document form
    • Fields/Sections - General Settings
    • Field- Types & Options
      • Field - Multi Checkbox
      • Field - Checkbox
      • Field - Radio Button
      • Field - Datepicker
      • Field - Radio Select
      • Field - Select
      • Field - Multiline
      • Field - Number
      • Field - TextField
    • Conditional Fields & Sections
    • Shared Forms
      • Sharing Forms
      • Shared Form Configuration
      • Consent Form (GDPR)
      • Embeed & customize shared form on your website
  • Spreadsheet
    • Create Documents using Spreadsheet
  • API
    • Create Documents using API & JSON
    • Integrate with Documentero Cloud API
  • ChatGPT
    • Create Documents using ChatGPT
  • Integrations
    • Zapier
    • Make.com
    • Integrately
    • Pabbly Connect
    • Albato
    • Bubble.io Plugin
    • Webflow
    • Flutterflow
Powered by GitBook
On this page
  • Smart Fields to calculate values
  • Smart Fields Numbers vs Strings
  • Use Special Filters to modify results
  • Special Smart Fields
  1. templates

Smart Fields

Smart fields use a special tag that starts with "$". They cannot be provided by a user in the form. Those fields are build or calculated based on existing nonsmart regular fields.

PreviousSections - Types & OptionsNextSmart Sections

Last updated 14 hours ago

Smart Fields to calculate values

Labor: {labor} USD
Parts: {parts} USD
Total: {$ labor + parts} USD
Total + Tax: {$ (labor + parts) * 1.22}

You can use smart field to do simple and advanced calculations based on provided user form input.

Make sure that you pick “NumberField” in form customization to prevent users from using text instead of numbers for fields that you want use for your calculations.

Smart Fields Numbers vs Strings

If you want to accept strings and convert them into numbers for further calculations (useful if you integrate with the external system) you can use the special syntax within smart fields like : +[fieldname]. Example:

Assuming:
field1: "2",
field2: "5"
field3: 2,
field4: 5

{$ field1 + field2 } ==> 25
{$ field3 + field4 } ==> 7

{$ +field1 + +field2 } ==> 7 
// Converts "2" into Number 2 and "5" into 5

Use Special Filters to modify results

Smart Fields for conditions

You can use conditions to output element based on value provided from different field (from user)

General Condition Schema:

{$ [CONDITION] ? [TEXTIFTRUE] : [TEXTIFFALSE]}

Examples:

{$ FIELDNAME == 'VALUETOCOMPARE' ? 'textIfTrue' : 'textIfFalse'}
{$ FIELDNAME != 'VALUETOCOMPARE' ? 'textIfTrue' : 'textIfFalse'}
{$ FIELDNAME > NUMBERTOCOMPARE ? 'textIfTrue' : 'textIfFalse'}
{$ FIELDNAME < NUMBERTOCOMPARE ? 'textIfTrue' : 'textIfFalse'}

Supported operators:

== (Equal),
!= (Not Equal),
> (More Than)
< (Less Than)
&& (And)
|| (OR)

Example #1

Name: {name}
Surname: {surname}
Sex: {sex}
Full Name: {$ sex == 'woman' ? 'Mrs.' : 'Mr.'} {name} {surname}

Example #2

Name: {name}
Age: {age}
Status: {$ age > 18 ? 'Adult' : 'Underage'}

Special Smart Fields

Show Current Time & Current Date with Format & Timezone

You can display current time or date using special smart field.

It supports two optional parameters:

{$currentDate | date:'[format]':'[timeZone]':'[dateStyle]'}

{$currentTime | date:'[format]':'[timeZone]'}

We still support old format: {$currentDate>[format]>[timeZone]}

format [optional] - output format using language code (12 hours vs 24 hours etc.) - Examples: en-US, en-GB, fr-FR, de-DE, pl-PL, es-ES, it-IT | Default: 'en-US'

timeZone [optional] - timezone in Intl format - Examples: America/Chicago, Europe/Berlin, Europe/Warsaw, Europe/Rome | Default: 'Universal' UTC Timezone See list of Available Timezones:

dateStyle [optional] - available options: short, medium, long, full | Default: 'medium'

If incorrect format / timezone will be provided Documentero will use default values.

Examples for time:
{$currentTime} ---> 6:57:14 PM 
{$currentTime | time:'en-US'} --->  6:57:14 PM 
{$currentTime | time:'de-DE} --->  18:57:14 
{$currentTime | time:'de-DE:'Europe/Berlin'} --->  20:57:14 
{$currentTime | time:'de-DE:'America/Chicago'} --->  13:57:14 
{$currentTime | time:'de-DE:'America/New_York'} --->  14:57:14 
{$currentTime | time:'en-US:'America/Chicago'} --->  1:57:14 PM
{$currentTime | time:'en-US:'America/New_York'} --->  2:57:14 PM

Examples for date:
{$currentDate} ---> 4/28/2023
{$currentDate | date:'en-US'} --->  4/28/2023 
{$currentDate | date:'de-DE'} --->  28.4.2023 
{$currentDate | date:'de-DE':'Europe/Berlin'} --->  28.4.2023

{$currentDate | date:'en-US':'Universal'} ---> 5/8/2025
{$currentDate | date:'en-US':'Universal':'short'} ---> 5/8/25
{$currentDate | date:'en-US':'Universal':'medium'} ---> May 8, 2025
{$currentDate | date:'en-US':'Universal':'long'} ---> May 8, 2025
{$currentDate | date:'en-US':'Universal':'full'} ---> Thursday, May 8, 2025

{$currentDate | date:'de-DE':'Universal'} ---> 8.5.2025
{$currentDate | date:'de-DE':'Universal':'short'} ---> 08.05.25
{$currentDate | date:'de-DE':'Universal':'medium'} ---> 08.05.2025
{$currentDate | date:'de-DE':'Universal':'long'} ---> 8. Mai 2025
{$currentDate | date:'de-DE':'Universal':'full'} ---> Donnerstag, 8. Mai 2025

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones