Get code from template ui element
Function: Get code from template UI element
This action allows you to retrieve the underlying code that defines a specific UI element that has been saved as a template. This is useful when you need to inspect, modify, or dynamically use the template's code within your application, perhaps to display it, save it, or process it further.
Input
- UI element (UI element): The specific template UI element from which you want to extract the code. This input is required.
Output
- Code (Text): The actual underlying code (e.g., HTML, CSS, JavaScript, or platform-specific markup) of the selected template UI element. This code will be stored in a variable that you specify within your workflow.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Get code from template UI element" action:
Example 1: Displaying a Template's Code for Review
Imagine you have a "Product Card" template and you want to quickly view its underlying structure to ensure it meets design standards or to share it with a developer.
- Inputs:
- UI element:
Product Card Template
- UI element:
- Result: The action retrieves the HTML/CSS code for the "Product Card Template" and stores it in a variable named
productCardCode. You can then display thisproductCardCodein a text area on an admin page for review.
Example 2: Dynamically Loading Template Content
Suppose you have different email templates (e.g., "Welcome Email", "Order Confirmation") and you want to load the content of a specific template based on a user's action or a system event.
- Inputs:
- UI element:
Welcome Email Template
- UI element:
- Result: The action fetches the full HTML content of the "Welcome Email Template" and saves it into a variable called
emailBodyContent. ThisemailBodyContentcan then be used as the body for an outgoing email.
Example 3: Auditing Template Changes
You might want to keep a log of the code for critical UI templates whenever they are updated, to track changes over time.
- Inputs:
- UI element:
Main Navigation Bar Template
- UI element:
- Result: The action retrieves the code for the "Main Navigation Bar Template" and stores it in a variable named
navBarVersionCode. ThisnavBarVersionCodecan then be saved to a database table along with a timestamp, creating an audit trail of the template's structure.