Guides & Best Practices
Writing Custom Code in Embeddables
How to get the most out of custom code blocks in Embeddables
Custom Code blocks in Embeddables are where you can escape the confines of no-code and create entirely custom functionality.
Custom Code exists in two main places: Computed Fields and Actions.
Available arguments in Custom Code functions
Custom Code blocks provide various bits of context through arguments in the root functions. They are, in order:
# | Argument | Description |
---|---|---|
1 | userData | The current User Data |
2 | helperFunctions | An object containing various helper functions (see full list below) |
3 | triggerContext | An object containing data on what triggered the Computed Field or Action (see full list below) |
Helper Functions
The following helper functions are available in both Computed Fields and Actions through the helperFunctions
argument:
Page Navigation Functions
Data Management Functions
Component and UI Functions
Action and Flow Control
Analytics and Events
Additional Helpers
Trigger Context variables
Please note that old_user_data
and new_user_data
currently only
contain the input keys for the Computed Field, not all of User Data. This may
change in the future.