Manage User-defined Functions
Overivew
This guide shows how to create and use User-defined Functions in Sift to simplify and centralize logic across Rules and Calculated Channels. It covers practical actions like defining a function using CEL, referencing it in expressions, managing versions, and updating shared logic safely. Use this guide when you want to reduce duplication, improve expression clarity, and maintain consistent telemetry calculations across your workspace.
Instructions
Create a User-defined Function
To create a User-defined Function:
- In Sift, click .
- In the Sift navigation menu, click User-defined Functions.
- Click + New Function.
- In the User-defined function name box, enter a name for the User-defined Function.
When creating a User-defined Function, follow the following naming requirements:
- No spaces
- The name must be 1 to 253 characters long
- Must start with a letter
- Use only letters, numbers, and underscores
- Optional: In the Description box, enter a description for the User-defined Function.
- In the Number list (inside the Inout Channels box), select an input data type for the first input Channel ($1).
- To add other input Channels, consider the following steps:
- Inside the Input Channels box, click Plus.
- In the new Number list. Select an input data type for the second input Channel ($2).
- In the Enter an expression box, define the expression for the User-defined Function using the previously created (defined) input Channels.
- Click Save.
Preview a User-defined Function
To preview a User-defined Function:
- In Sift, click .
- In the Sift navigation menu, click User-defined Functions.
- In the User-defined Functions table, click the user-defined function you want to preview.
- In the Preview box, click click Plus.
- In the Runs table, select a Run to preview the User-defined Function.
- Click Next.
- In the Select Channels tab, select the Channels from the selected Run to associate with the created input Channels.
- Click Preview.
Edit a User-defined Function
To edit a User-defined Function:
- In Sift, click .
- In the Sift navigation menu, click User-defined Functions.
- In the User-defined Functions table, click the User-defined Function you want to edit.
- Click Edit.
- Edit and preview your changes.
- Click Save changes.
Making and saving changes to a User-defined Function creates a new version of that User-defined Function. However, there are some important limitations to be aware of when editing:
- Name: The User-defined Function name can only be edited if it has not yet been referenced by anything else.
- Input Channels: The Input Channels can be modified as long as they are not currently being referenced elsewhere.
Archive a User-defined Function
To archive a User-defined Function:
- In Sift, click .
- In the Sift navigation menu, click User-defined Functions.
- In the User-defined Functions table, click the user-defined function you want to archive.
- Click More options.
- Select Archive.
- Click Archive Function.
Unarchive a User-defined Function
To unarchive a User-defined Function:
- In Sift, click .
- In the Sift navigation menu, click User-defined Functions.
- Click Show Archived.
- In the User-defined Functions table, click the user-defined function you want to unarchive.
- Click More options.
- Select Restore.