Ask AI
Skip to main content

Get code from template ui element

Function: Get code from template ui element

This action allows you to retrieve the underlying definition or content of a specific visual component (UI element) that you have placed on one of your application templates. Think of it as getting the blueprint or the exact text of a part of your page. This is useful when you want to inspect, save, or dynamically work with the content or structure of your UI elements without needing to know any programming.

Input

  • UI element: This is the specific visual component (like a button, text field, image, or a custom block) on your template that you want to examine or extract information from. You will select this directly from your template editor.

Output

  • Code: This is the extracted definition or content of the selected UI element. It will be stored as a piece of text (a string variable) that you can then use in other actions, display, or save.

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Get code from template ui element" action:

  1. Inspecting a Custom Component's Configuration

    • Scenario: You have a custom "Product Card" UI element on your product detail page template. You want to see its internal configuration (e.g., which fields it displays, its layout settings) to debug an issue or replicate it.
    • Inputs:
      • UI element: "Product Card (on Product Detail Template)"
    • Result: The action retrieves the configuration details of the "Product Card" UI element as a text string and stores it in a variable named productCardConfig. This variable can then be displayed in a pop-up or logged for review.
  2. Dynamically Modifying a Text Block's Content

    • Scenario: You have a "Welcome Message" text block on your homepage template. You want to retrieve its current content to append a personalized greeting before displaying it to a logged-in user.
    • Inputs:
      • UI element: "Welcome Message Text Block (on Homepage Template)"
    • Result: The action retrieves the current text content of the "Welcome Message Text Block" as a string and stores it in a variable named currentWelcomeText. This currentWelcomeText can then be modified (e.g., currentWelcomeText + " " + currentUser.name) and set back to the text block.
  3. Saving a UI Element's Structure for Backup or Reuse

    • Scenario: You have designed a complex "Contact Form" UI element with many fields and validation rules. You want to save its entire structural definition to a database or a file for backup purposes or to easily recreate it elsewhere.
    • Inputs:
      • UI element: "Contact Form (on Contact Us Template)"
    • Result: The action retrieves the complete structural definition of the "Contact Form" UI element as a detailed text string and stores it in a variable named contactFormStructure. This contactFormStructure can then be saved to a database field or exported as a text file.