1. Home
  2. Using INO CX
  3. Magic fields and variables

Magic fields and variables

[Reading time: 8 minutes]

Overview

Variables and magic fields are powerful tools that allow you to automate and personalize content in INO cx. They make it easier to dynamically insert data from the CRM, interactions, campaigns, and other sources directly into your configurations.

Magic fields can be used in Smart Routings, workflows, scripts, customized buttons, and web services.

What is a variable?

A variable is a dynamic element that is replaced with a specific value when used. In INO cx, several types of variables are available:

  • INO cx variables: These are automatically filled in automatically by INO cx and follow the “mustache” syntax: {{variable_name}}.
  • Custom variables: These must be provided by the user at the time of use and follow the “dollar” syntax: $$variable_name$$.

What is a magic field?

A magic field is an input area where you can insert free text, INO cx variables, and sometimes custom variables.

Magic fields are identified by the presence of a magic wand icon next to the field.

  • Blue magic wand: Allows you to insert text and INO cx variables.
  • Purple magic wand: Allows you to insert text, INO cx variables and custom variables.

Using variables in magic fields

Basic syntax

  • {{variable_name}}: Inserts the value of an INO cx variable.
  • $$variable_name$$: Requests a value from the user at the time of use.

Accessing objects and lists

You can navigate through nested objects and lists:

  • {{parent.child}}: Accesses a child property of an object.
  • {{list[0]}}: Accesses the first element of a list.

Usage examples

  • {{card.firstname}} ➡️ Replaced with the CRM contact’s first name (e.g., John).
  • http://{{case.link}}/help ➡️ Replaced with the case link.
  • #call-{{interaction.id}}-{{card.id}} ➡️ Replaced with the interaction and CRM record IDs.
  • $$clientName$$ ➡️ Requests a custom value from the user.

List of INO cx variables

For the current CRM card: 

{{card.id}} : Identifier
{{card.firstname}} : First name field
{{card.lastname}} : Last name field
{{card.phonenumber}} : Telephone field
{{card.email}} : Email address field
{{card.messengerId}} : Messenger ID field
{{card.customerContactId}} : CRM identifier of the recognized card
{{card.api_field_name}} : Replace api_field_name by the API name of the CRM customized field.

For the current case:

{{case.reference}} : Reference field
{{case.title}} : Title field
{{case.description}} : Description field
{{case.kind}} : Type ID field
{{case.origin}} : ID of the origin field
{{case.status}} : ID of the status field
{{case.reason}} : ID of the reason field
{{case.priority}} : Priority field (from 1 to 4)
{{case.owner}} : ID of the owner field
{{case.api_field_name}} : Replace api_field_name with case customized field API name.

For the current moment:

{{date.now}} : Date at a given moment in system format, in the interaction time zone (configured at the entry point), if empty in that of the customer account.

For the current campaign target: 

{{target.number}} : Contact number
{{target.result}} : Status (possible values: PENDING, PROCESSING, CANCELED, RESCHEDULED, DONE, OVER, NO_USER, NO_RESPONSE, LIMIT, TRANSFER, MACHINE_DETECTED).
{{target.priority}} : Priority (between 1 and 100)
{{target.cardId}} : ID of the CRM card linked to the current campaign target
{{target.startDate}} : Date from which target must be contacted
{{target.id}} : ID
{{target.attempt.id}} : Attempt ID
{{target.attempt.interactionId}} : Interaction attempt ID
{{target.attempt.sessionId}} : Session ID associated with the current attempt
{{target.attempt.sessionTag}} : Session TAG associated with the current attempt
{{target.campaign.id}} : ID of the campaign associated with the current target
{{target.campaign.tag}} : Campaign TAG associated with the current target
{{target.data.api_field_name}} : Replace api_field_name with the API name of the target customized field.

For the current interaction: 

{{interaction.id}} : ID
{{interaction.direction}} : Direction: incoming or outgoing (possible values: in, out)
{{interaction.endCustomer.endpoint}} : Customer details (e.g.: number, ID messenger, email address, etc.)
{{interaction.endCustomer.countryCode}} : Caller country code
{{interaction.endCustomer.country}} : Caller country code
{{interaction.endCustomer.dpt}} : Caller department
{{interaction.endCustomer.dptCode}} : Caller department code
{{interaction.origin.value}} : Interaction receiver (e.g. number called, email address, chat URL, etc.)
{{interaction.startDate}} : Start date
{{interaction.endDate}} : End date.
{{interaction.status}} : Status (“ACCEPTED” – Accepted | “CANCELED” – Canceled | “CLEAN” – Completed | “DISSUADED” – Dissuaded | “DISSUADED_BY_CUSTOMER” – Dissuaded by customer | “FAILED” – Failed | “MAX_ESTIMATED_EXCEEDED” – Maximum estimated waiting time reached | “MAX_TREATMENT_TMO” – Maximum processing time reached | “MAX_WAITING_EXCEEDED” – Maximum waiting time reached | “MISSED” – Missed | “NO_USER” – No advisor available | “PENDING” – Pending | “REFUSED” – Refused | “DISTRIBUTION_TMO” – Maximum distribution time reached | “TRANSFERRED” – Transferred | “TRANSFER_CANCELED” – Transfer canceled | “TREATED” – Processed | “TREATED_NORESPONSE” – Processed without reply | “USER_DENIED_MEDIA_ACCESS” – User refused mic access)
{{interaction.distributionLifeItem.status}} : Distribution status (“TREATED” – Processed | “DISSUADED” – Dissuaded | “CANCELED” – Canceled)
{{interaction.distributionLifeItem.distributionQueueId}} : Identifier of the queue to which the interaction was distributed.
{{interaction.distributionLifeItem.ownerParticipantId}} : Identifier of the user to which the interaction was distributed.
{{interaction.lastSurvey}} : Latest survey answers. Example, to retrieve the value for the first answer of the survey: interaction.lastSurvey.answers[0].value.
{{interaction.variable.variable_name.api_field_name}} : Value of a INO cx variable property: replace variable_name with the variable API label and api_field_name with the variable field name. All fields are accessible regardless of their type.
{{interaction.clickToCallData.cardId}} : Identifier of the object from which “click to call” was enabled.
{{interaction.clickToCallData.objectType}} : Type of object from which “click to call” was enabled.

For the current email: 

{{email.subject}} : Subject
{{email.text}} : Content in text format
{{email.html}} : Content in HTML format

For the current invoice: 

{{bill.id}} : ID
{{bill.name}} : Name
{{bill.billReference}} : No.
{{bill.endCustomerId}} : Customer no.
{{bill.phoneNumber}} : Telephone number
{{bill.email}} : Email address
{{bill.amount}} : Amount
{{bill.link}} : Link

8. Access properties of a customized INO cx variable

{{variable.values.explanation.variable.custom.key}} :

For the current workflow: 

{{workflow.id}} : Identifier
{{workflow.event.name}} : Trigger name
{{workflow.event.category}} : Trigger category
{{workflow.event.data.nom_api}} : Trigger data: replace api_name with the corresponding datum (case.id / interaction.id / etc.). For more information, see the webhook documentation directly in the customer account settings.
{{workflow.data.nom_api}} : Setting keys: replace api_name with the key name.

Filters applicable to variables

You can apply filters to variables to transform them before use.

1. Formatting filters

{{…||format.phone.international.value}} : Changes a national number into an international format. The last digits of the filter are used to specify the area code. {{variable.nom_de_la_variable.nom_api_du_champ||format.phone.international.33}}.
{{…||format.phone.national}} : Changes an international number into a national format. {{variable.nom_de_la_variable.nom_api_du_champ||format.phone.national}}.
{{…||format.date.YY}} : formats the variable year as 2 digits. Example: {{variable.nom_de_la_variable.nom_api_du_champ||format.date.YY}}. Formats can be combined to give, for example: {{variable.nom_de_la_variable.nom_api_du_champ||format.date.DD/MM/YYYY}}.
{{…||format.date.YYYY}} : formats the variable year as 4 digits.
{{…||format.date.Q}} : formats the variable quarter as 1 digit.
{{…||format.date.M}} : formats the variable number of the month of the year as 1 or 2 digits.
{{…||format.date.MM}} : formats the variable month of the year as 2 digits.
{{…||format.date.MMM}} : formats the variable month of the year as 3 letters.
{{…||format.date.MMMM}} : formats the variable month of the year in all letters in English.
{{…||format.date.D}} : formats the variable day of the month as 1 or 2 digits.
{{…||format.date.DD}} : formats the variable day of the month as 2 digits.
{{…||format.date.DDD}} : formats the variable day of the year as 1, 2 or 3 digits.
{{…||format.date.DDDD}} : formats the variable day of the year as 3 digits.
{{…||format.date.W}} : formats the variable week number as 1 or 2 digits.
{{…||format.date.WW}} : formats the variable week number as 2 digits.
{{…||format.date.E}} : formats the variable weekday number as 1 digit..

2. Text-To-Speech filters

{{…||spell.value}} : the digits contained in the variable will be spelled out by groups of digits. The last digit of the filter is used until the end. Example to spell out 0 612 34 xx xx xx : {{variable.nom_de_la_variable.nom_api_du_champ||spell.1,3,2}}.

3. substring of characters filters

{{…||substring.x}} : with the x value as the index from which to start the extraction. Example: to remove the + on +33123xxxxxx: {{variable.nom_de_la_variable.nom_api_du_champ||substring.1}}.
{{…||substring.x.y}} : with the x value as the index from which to start the extraction and the y value as the index before which to end the extraction. Example for the text “hello”, if you want to keep “ell”: {{variable.nom_de_la_variable.nom_api_du_champ||substring.1.4}}

4. dateS filters

{{…||date.date}} : formats the variable date as YYYY/MM/DD. Example: {{variable.nom_de_la_variable.nom_api_du_champ||date.date}}
{{…||date.dateFR}} : formats the variable date as DD/MM/YYYY.
{{…||date.datetime}} : formats the variable date as YYYY/MM/DD HH:mm:ss.
{{…||date.datetimeFR}} : formats the variable date as DD/MM/YYYY HH:mm:ss.
{{…||date.time}} : formats the variable time as HH:mm:ss.
{{…||date.day}} : formats the variable day of the month as 2 digits.
{{…||date.month}} : formats the variable number of the month of the year as 2 digits.
{{…||date.year}} : formats the variable year as 4 digits.
{{…||date.hour}} : formats the variable hour as HH.
{{…||date.minutes}} : formats the variable minutes as mm.
{{…||date.seconds}} : formats the variable seconds as ss.
{{…||date.timestamp}} : formats the variable date as Unix Timestamp (number of seconds elapsed since January 1st, 1970).
{{…||date.utc}} : formats the variable date as UTC (Coordinated Universal Time).
{{…||date.datetimeTz}} : formats the variable date in time zone format (2024-12-10T15:30:00+01:00).
{{…||date.dateTimeWithTz}} : formats the variable date and hour based on the time zone, using the abbreviation code entered as a setting (Example: {{interaction.startDate || date.dateWithTz.cest}}).
{{…||date.dateWithTz}} : formats the variable date based on the time zone, using the abbreviation code entered as a setting (Example: {{interaction.startDate || date.dateWithTz.cest}}).

Conclusion

Variables and magic fields are powerful tools for personalizing and automating information processing in INO cx. With INO cx and custom variables, you can dynamically insert data into your interactions. Filters allow you to adjust the format of variables to meet specific user needs.

Updated on 2025-03-28
Was this article helpful?