Guided Workflow Custom Components - Run Script
Updated
Overview
The Run Script component allows you to execute JavaScript on a screen to perform specific actions. This feature is primarily used for advanced functionalities and custom behaviors. Here are some examples of its usage:
Displaying a Button After a Delay: You can write a script to show a particular button on the screen after a specified time.
Making API Calls: You can use this component to call APIs directly from the screen to fetch or update data dynamically.
Note: This feature requires JavaScript coding and needs support from the developement team.
Various Fields in Run Script
API Name: This is the unique identifier for this button. For this widget, you need to ensure that there are no hyphens and spaces in this API Name field input. Ensure that the name does not start with a number or underscore.
Local Storage Key: This refers to the name of the variable.
Script: You can add your Java Script in this field.
Controlling field: It allows you to display data based on certain inputs from previous components. For example, if you've built a custom app for payments and you want to show the payments based on dates, you can set the Date as the controlling field. This way, the app will display payments for a specific date range.
Similarly, if you have a list of cities or states, you can choose country as the controlling field. This will make the list of states populate based on the selected country. Essentially, controlling fields let you filter and display data dynamically based on user choices.
Templated Props: Templated props are inputs provided to the app that determine the data it will display. For example, if you're building an airline UI, you can use the PNR (Passenger Name Record) as a templated prop. When the PNR is entered, the app can display details of all the available seats. Essentially, templated props act as dynamic inputs that customize the app's output based on the specific data you provide.
Visibility Conditions: It is a rule or set of rules that determine whether a specific element, field, or component is visible to users in an application or interface. These conditions are typically based on factors such as field values, or contextual data. Visibility conditions ensure that users only see relevant information, improving usability and security.
Example
Condition: Display a "Priority Escalation" section if the "Ticket Priority" is set to "High."
Implementation: Visibility Condition: Ticket_Priority == 'High'
Result: The "Priority Escalation" section appears only for high-priority tickets.