9

Smart Fields

Customer Support

Last Update et år siden

Overview

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. They can be used for simple or advanced automated calculations from provided values or other combinations.

Smart Fields to calculate values

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:

Use Special Filters to modify results

You can format values correctly using Field Filters Check More eg.:

Smart Fields for conditions

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


General Condition Schema:

Examples:

Supported operators:

== (Equal),

!= (Not Equal),

> (More Than)

< (Less Than)

&& (And)

|| (OR)


Example #1

Example #2

Different operators

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:

{$currentTime>[format]>[timeZone]}

{$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:

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


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

Template Variable Assignments

Sometimes you want to calculate some value based on data input and reuse it across the document. You can do that using assignments within smart fields then you can use assign value withing Smart Fields or Smart Sections Multiple Times

Was this article helpful?

3 out of 3 liked this article