Scriptable Functions has arrived on the UI in the form of Action Buttons 🙌
This feature allows administrators to extend Layer functionality by creating action buttons against specific Layer record types.
Typical use cases include:
Data Retrieval - Obtaining data from third party systems, such as eligibility for upgrade, third party system case status, coverage checks etc.
Synchronisation - Creating and updating records between The Layer and a third party system
Checks & Verification - Credit checks, KYC, any other supported API checks
Custom Screens - Showing data formatted in HTML
If you have an API endpoint, you can probably build it with LayerScript®
Sample Action Button
Example placement of a Scriptable Function button, reaching out to Ofcom
The Scriptable Functions Buttons feature is comprised of the following components:
Custom Buttons 🔘 Add custom buttons to certain record types
Interruptions 💻 Optionally add a screen to capture data before execution
Pre-Fill 📄 Have these values pre-populated in supported types
Run 🧮 Perform reads, edits or updates on third party systems via existing Scriptable Functions framework
Show 📺 Display the results directly on the UI
Let's create a simple "Hello World" application, which will return the name of the user.
The first thing to note, is that the content displayed to the end user is derived from the return value of the Scriptable Function.
e.g. return "Hello %%Name%%";
Create Scriptable Function
Create a new Scriptable Function and enter any parameters required in the Interruption (the screen which prompts for any relevant data) between double percentages.
Note: These are different to tenant wide parameters in double dollars and must be entered during every execution! Having both options ensures we can customise these functions and bundle them for distribution.
Next, click Buttons on the left panel, which will allow you to map this Scriptable Function to a new button.
It's as simple as that!
Now navigate to any lead, and you'll see your new Action Button appear on the page.
Click it, and you'll be presented with the Interruption screen, allowing you to capture the data prior to executing it.
Note: If you use a property that already exists for the type (e.g. Postcode), then it will pre-fill the data for you! This can be particularly useful for saving time.
This is a very basic example, and the output is only limited by your imagination 🤔
Here's a slightly more complex example, which utilises the built-in Scriptable Function Extension ScriptableFunctionJsonToHtml, auto formatting JSON responses to HTML tables.
Feel free to reach out if you have any questions regarding this feature.