Views: 7093
Last Modified: 13.10.2021

Modifying the data

Parameters, template variables or element fields can be modified. Special modifiers exist to convert such data.

Template parameters and variables, as well as document fields use the _printable modifier that converts values into an easy-to-understand string.

For example, user variable type. If value is Author, then:

                           
{=Variable:user}                          author
{=Variable:user_printable}                Author

If permitted, element fields or parameter can be displayed in the same manner as in the form Value insert. But, if printable form is unavailable, request printable display from any value Example: {=Variable:Datetime > date, printable} // converting to printable format (variable, additional result and etc.).

In addition to 'printable' you can use the modifier (text) to convert into text the fields with content not intended for print. Example of such field is Phone in CRM entity. Record format: {{Phone (text)}}.

Example of modifying the Phone field to print a comment in Contact details

Converting data types

In addition to the above, you can convert not only into the print form, but also changing the data type:

{=Variable:string>date} // преобразование строки в дату 

Find all the options for such conversion in data type conversion table.

friendly

User data type can be converted into friendly format. In this case, prints only user first and last name, without ID and login.

Example: {=Document:CREATED_BY} > User_1

{=Document:CREATED_BY > printable} > John Smith [1]

{=Document:CREATED_BY > friendly} > John Smith

Important! Variables and PHP code actions can be used for data type conversion, including print form query for values without printable form (for module version earlier than 15.6.0).

Note: using Value insert form is optional for inserting the same value into different template actions. It's sufficient to copy the text, inserted via the this form and use it.


Data type conversion table

Examples of specific issue resolution (for Bitrix24 On-premise)

0


Courses developed by Bitrix24