Power Actions allows you to update Zendesk fields without the need to build a full Action Flow. When configuring an action, many field values support Liquid markup, allowing you to dynamically transform data before it is written back to the ticket.
In addition to copying values from one field to another, Liquid can be used to perform calculations, compare values, and return different outputs based on ticket data. This makes it easy to automatically calculate totals, map numeric values to dropdown options such as ticket priority, format text, and build more intelligent update logic, all within a single Power Action.
This article covers two common examples:
- Multiplying the values of two number fields.
- Setting a ticket priority based on the value of a number field.
Example 1: Multiply two number fields
If you have two Zendesk number fields, you can multiply them together using the times filter.
For example, if one field contains a quantity and another contains a unit price, you could calculate the total value.
Liquid
{% assign value_1 = ticket.ticket_field_12345678901234 | plus: 0 %}
{% assign value_2 = ticket.ticket_field_23456789012345 | plus: 0 %}
{{ value_1 | times: value_2 }}Result
If:
- Number field 1 =
10 - Number field 2 =
25
The output will be:
250
Example 2: Set the ticket priority from a number field
Liquid can also be used to return different values based on conditions.
The following example sets the ticket priority according to the value stored in a number field.
Liquid
{% assign value = ticket.ticket_field_12345678901234 | plus: 0 %}{% if value > 5000 %}urgent{% elsif value > 2500 %}high{% elsif value > 1000 %}normal{% else %}low{% endif %}Result
| Number field value | Output |
|---|---|
| 6000 | urgent |
| 3000 | high |
| 1500 | normal |
| 500 | low |
This example can be used when updating the Zendesk Priority field from a Power Action.
Learn more
Looking to do more with Liquid? Our guide Liquid Markup: An overview of common uses in Zendesk covers the fundamentals, common filters, placeholders, and additional examples to help you build more advanced workflows.