Ask AI
Skip to main content

Get argument value from template ui element

Function: Get argument value from template ui element

This action allows you to retrieve a specific piece of information, known as an "argument," that has been configured within a UI element on your page. This is useful when a UI element (like a custom component or a reusable template) holds dynamic data or settings that you need to use elsewhere in your application logic.

Input,

  • UI element (Required, Type: UI element) The specific UI element on your page from which you want to extract an argument's value. This element must be based on a template.
  • Argument (Required, Type: Text) The exact name of the argument whose value you wish to retrieve from the selected UI element.

Output,

  • Value (Type: Text) The retrieved value from the specified argument. This value will be stored in a variable that you define, ready for use in subsequent actions.

Execution Flow,

Real-Life Examples,

Example 1: Getting a Product ID from a Product Card

Imagine you have a "Product Card" UI element on your e-commerce page, which displays product details. This card has an internal argument named productId that stores the unique identifier for the product it represents. You want to get this ID to pass it to a "Add to Cart" action.

  • Inputs:
    • UI element: Product Card 1 (the specific product card on your page)
    • Argument: productId
  • Result: The unique product ID (e.g., "P12345") is retrieved and stored in a variable named currentProductId. You can then use currentProductId in other actions.

Example 2: Retrieving a Default Message from a Notification Banner

You've designed a "Notification Banner" UI element that can display various messages. It has a default message argument called defaultGreeting. When a user logs in, you want to display this default greeting.

  • Inputs:
    • UI element: Welcome Notification Banner
    • Argument: defaultGreeting
  • Result: The text "Welcome back to your dashboard!" is retrieved and stored in a variable named bannerMessage. This bannerMessage can then be used to update the banner's display.

Example 3: Accessing a Configuration Setting from a Custom Widget

You have a "Settings Widget" UI element that allows users to customize their profile. This widget has an argument named themeColor which stores the user's preferred color. You want to apply this color to other parts of the application.

  • Inputs:
    • UI element: User Profile Settings Widget
    • Argument: themeColor
  • Result: The hexadecimal color code (e.g., "#FF0000" for red) is retrieved and stored in a variable named userThemeColor. This userThemeColor can then be used to dynamically style other UI elements.