Functions in document templates: Difference between revisions

From Planfix
Jump to: navigation, search
(Created page with "{{#seo: |title=Planfix API project.add |titlemode=append |keywords= Planfix, project, project.add, api |description=Planfix API project.add }} Functions can be used when autom...")
 
No edit summary
Line 13: Line 13:


Example:
Example:
%%%TEXT({{DataTag.Service.Quantity}}*{{DataTag.Service.Cost}};"2f")%%%
<div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;"><nowiki>%%%TEXT({{DataTag.Service.Quantity}}*{{DataTag.Service.Cost}};".2f")%%%</nowiki></div>




In the example above, data from the "Service" data tag is added to the formula using the corresponding variables. The two values are multiplied, and the result is the value of the total cost of a specific service or product. The TEXT() function formats the value as a human-readable text string.
In the example above, data from the "Service" data tag is added to the formula using the corresponding variables. The two values are multiplied, and the result is the value of the total cost of a specific service or product. The TEXT() function formats the value as a human-readable text string.

Revision as of 14:18, 6 October 2022

Functions can be used when automatically formatting documents using templates. Functions simplify how data is displayed in your documents. For example, you can use formulas to automatically display numbers as words or calculate order costs.

Formulas

To add a formula to a document, use the following syntax: %%%FORMULA%%%.

A FORMULA is an expression for calculating the value of a field, just like in a calculated field.

Example:

%%%TEXT({{DataTag.Service.Quantity}}*{{DataTag.Service.Cost}};".2f")%%%


In the example above, data from the "Service" data tag is added to the formula using the corresponding variables. The two values are multiplied, and the result is the value of the total cost of a specific service or product. The TEXT() function formats the value as a human-readable text string.