Get answer from template ui element
Function: Get answer from template UI element
This function allows you to retrieve a specific piece of information (an "answer") from a UI element that is part of a template. You specify which template UI element to look into and then pinpoint the exact sub-element within it from which you want to extract the data. The retrieved answer will then be stored in a variable of your choice for further use in your application.
Input
- UI element (PART): This is the main template component or UI element from which you want to get an answer. You need to provide the specific UI element that contains the sub-element you are interested in. This input is required.
- Sub UI element (STRING): This is the unique code or identifier for the specific sub-element within the chosen UI element from which you want to retrieve the answer. For example, if your UI element is a form, the sub-UI element could be a specific text field or a dropdown. This input is required.
Output
- Answer (STRING): The actual value or data retrieved from the specified "Sub UI element". This value will be stored in a variable whose name you provide when configuring this action.
Execution Flow
Real-Life Examples
Example 1: Getting a User's Selected Option from a Survey
- Scenario: You have a survey form displayed as a template UI element, and you want to capture the user's selection from a "Preferred Contact Method" dropdown within that form.
- Inputs:
- UI element:
SurveyFormTemplate(This would be the variable holding your survey form UI element) - Sub UI element:
contactMethodDropdown(This is the unique code for the dropdown within the survey form)
- UI element:
- Result: The value selected by the user in the
contactMethodDropdown(e.g., "Email", "Phone") is retrieved and stored in a variable namedpreferredContact.
Example 2: Extracting a Product ID from a Product Detail Page
- Scenario: Your application displays product details using a template UI element. You need to get the product ID from a hidden field or a specific text label on this page to use it in another action (e.g., adding to cart).
- Inputs:
- UI element:
ProductDetailPage(The UI element representing the product detail view) - Sub UI element:
productIdField(The unique code for the field displaying the product ID)
- UI element:
- Result: The product ID (e.g., "PROD12345") is retrieved from the
productIdFieldand stored in a variable namedcurrentProductId.
Example 3: Capturing a Comment from a Feedback Form
- Scenario: Users can submit feedback through a template-based form. You want to extract the text they entered into the "Comments" text area.
- Inputs:
- UI element:
FeedbackForm(The UI element for the feedback form) - Sub UI element:
commentTextArea(The unique code for the text area where users type comments)
- UI element:
- Result: The user's comment (e.g., "The app is great, but the search is slow.") is retrieved from the
commentTextAreaand stored in a variable nameduserFeedbackComment.