Onit Documentation

Generic Liquid Function

by Christina Moore Updated May 03, 2021

You can now save blocks of Liquid code in one App, and use them corporation-wide. In the Designer under Global Configuration, there is a new section titled Generic Liquid Functions.

Create a new Generic Liquid Function using the plus button and fill in the parameters as follows:

  • Parameters - declare names of variables that will contain information from outside the function
  • Liquid Body - this is the main part of the function, you can use all available Liquid tags and filters

Once you've saved your function, you can load it in the Liquid preview editor with a new menu icon:

All saved Generic Liquid Functions will show up in this menu. When you select one, it loads in the source editor along with an output tag:

You won't be able to preview this yet! You'll need to make an edit to the parameter line first, to indicate what the parameter should be.

The function shown above is meant to output roles and names of participants, so we want to pass in the Record's endorsements array. Once we make that edit, we can click Preview:

Previous Article How to Create a Record via Email
Next Article Creating a Sibling Relationship

© 2020 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.