Get argument value from template ui element
Function: Get argument value from template UI element
This action allows you to extract a specific piece of information, called an "argument value," from a UI element that is part of a template. Think of a UI element as a reusable block on your application's screen (like a product card, a user profile section, or a data table). These UI elements can have pre-defined settings or data points (arguments) associated with them. This action helps you retrieve the value of one of these settings.
Input
- UI element (PART): The specific UI element (component) on your template from which you want to retrieve an argument's value. You will select this element directly from your application's design.
- Argument (STRING): The exact name of the argument whose value you wish to get. This name must match an argument defined within the selected UI element.
Output
- Value (VARIABLE): The retrieved argument value will be stored in a variable that you specify. You can then use this variable in subsequent actions or display it in your application.
Execution Flow
Real-Life Examples
-
Getting a Product ID from a Product Card:
- Scenario: You have a "Product Card" UI element on your e-commerce template, and each card has an argument named "productId" that stores the unique identifier for the product it displays. You want to get this ID to show more details when a user clicks on the card.
- Inputs:
- UI element:
Product Card 1(the specific instance of the product card component) - Argument:
productId
- UI element:
- Result: The unique product ID (e.g., "P12345") is stored in a variable named
selectedProductId, which can then be used to fetch product details from your database.
-
Retrieving a User's Access Level from a Profile Widget:
- Scenario: Your application has a "User Profile Widget" UI element that displays basic user information. This widget has an argument called "accessLevel" which indicates if the user is an "Admin," "Editor," or "Viewer." You need to check this level to decide which options to show the user.
- Inputs:
- UI element:
Current User Profile Widget - Argument:
accessLevel
- UI element:
- Result: The user's access level (e.g., "Admin") is stored in a variable named
currentUserAccess, allowing you to conditionally display or hide features.
-
Checking if a Form Field is Editable:
- Scenario: You have a "Data Entry Field" UI element within a form template. This field has an argument named "isEditable" which can be set to
TrueorFalsedepending on the user's permissions or the form's status. You want to retrieve this setting to enable or disable the field. - Inputs:
- UI element:
Customer Name Input Field - Argument:
isEditable
- UI element:
- Result: A boolean value (e.g.,
TrueorFalse) is stored in a variable namedcanEditCustomerName, which can then be used to control the input field's interactivity.
- Scenario: You have a "Data Entry Field" UI element within a form template. This field has an argument named "isEditable" which can be set to