Onit Documentation

Working with Fields Liquid Examples

by Michael Nadeau Updated on

Determine If a Field is Either Blank or Null

For a Text Field: {% if matter_name == blank %}true{% endif %}

For a Date Field: {% if date_field == blank %}true{% endif %}

Access the Display or Save Value of a Combo Field:

Display Value: {{ atom | combo_display: 'combo_field_name' }}

Save Value: {{ atom | combo_value: 'combo_field_name' }}

*This does not work with ListCombo Fields

Access the Display or Save Value of a MultiSelect Field:

Display Value: {{ atom | combo_display: 'multiselect_field_name' }}

Save Value: {{ atom | combo_value: 'multiselect_field_name' }}

*This Liquid will return an Array of values

MultiCurrency Values

Get international currency code: {{ currency_field.currency }}

Get MultiCurrency Value: {{ currency_field.amount }}

Get MultiCurrency Value in subunits (e.g., cents):  {{ currency_field.cents }}

List Lookup

{{ [field_from_atom] | list_lookup: '[List Name]', '[column name to match]', '[column name to output]' }}

Below, we find the name field's value in the activity column in the T3 list and return the corresponding html_instructions from the matching row.

{{ name | list_lookup: 'T3', 'activity', 'html_instructions' }}

List Lookup – Whole Atom

If an atom is part of a Transaction List Provider, you can populate a variable with all its attributes. For example, you have a TLP that lists your legal entities. In your Matters app, once the legal entity is set, you want to look up its address, phone number, primary contact, and so on. Instead of doing 21 different list lookups, you can do one list_lookup_atom:

{% assign entity = legal_entity | list_lookup_atom: 'Legal Entities', 'name' %}

and then output:

{{ entity.address }}
{{ entity.country }}
{{ entity.main_billing_contact }}

... and so on.

Copy MultiCurrency Values

Suppose you have two apps, APP 1 and APP 2, which are related (parent-child, for example). You want to copy over a multi-currency field from APP 1 to APP 2 using an 'Update Related Transaction' action. Here is how we configure the params liquid property of the action:

p_mcf_app_2:{{mcf_app_1.amount}} {{mcf_app_1.currency}}

Note: mcf stands for Multi-Currency Field; of course, you need one multi-currency field in each app.

Update Attachment Field with a Document from a DocumentFolder Field

Suppose we have an App with an attachment field and a DocumentFolder field. We want to trigger and action that will set/update the content of the attachment field to the first document in the DocumentFolder field. Here is how we do it:

  • Create an Update Transaction action, and in the Params Liquid field, use this:
p_name_of_the_attachment_field: {{atom.documents[0]._id}}
  • Now we can create a button or business rule so we can attach the above Update Transaction action

Import a Textarea Field into a Word Document Without Losing Line Breaks

Pulling data from a Textarea Field using a Generate Document Action Word will remove the Textarea Field's formatting. This Liquid will look for line breaks and insert a split.

{% assign splits = '{ "key": "\r\n"}' | parse_json %}
{% assign lines = textarea_field | split: splits.key%}
{% for line in lines %}
{{line }}
{% endfor %}
Previous Article Date Calculations Liquid Examples
Next Article Emails and Links Liquid Examples

© 2024 Onit, Inc.

docs.onit.com contains proprietary and confidential information owned by Onit, Inc. that is subject to copyright. Onit presents it exclusively to you for your sole use in conjunction with using Onit products. No portion of the materials contained herein may be used for any other purpose. No portion of the materials contained herein may be shared with third parties or reproduced in any form.