Ask AI
Skip to main content

Get code of dropdown field

Function: Get code of dropdown field

This action allows you to retrieve the unique "code" associated with the currently selected option in a specific dropdown field on your application's screen. This is useful when you need to use a specific identifier for the selected item, rather than its display name, for tasks like database lookups, API calls, or internal logic.

Input

  • UI element (Dropdown Field): The dropdown field on your screen from which you want to extract the code of the selected option. You will select this directly from your application's user interface.

Output

  • Code (Text): The unique code of the selected option from the specified dropdown field. This value will be stored in a variable that you define, so you can use it in subsequent actions.

Execution Flow

Real-Life Examples

Example 1: Tracking Product Selection

  • Scenario: You have an order form where users select a product from a dropdown list. Each product has a display name (e.g., "Laptop Pro") and a unique internal product code (e.g., "LP-2023-001"). After the user selects a product, you want to store its internal code to process the order.
  • Inputs:
    • UI element: Select the "Product Selection" dropdown field.
    • Code: Specify a variable name, for example, selectedProductCode.
  • Result: The unique product code (e.g., "LP-2023-001") of the selected product will be stored in the selectedProductCode variable, ready for use in other actions like adding to a database or sending to an API.

Example 2: Dynamic Shipping Calculations

  • Scenario: Your application allows users to select a country for shipping from a dropdown. Each country has a display name (e.g., "United States") and a two-letter country code (e.g., "US"). You need the country code to look up shipping rates from an external service.
  • Inputs:
    • UI element: Select the "Shipping Country" dropdown field.
    • Code: Specify a variable name, for example, shippingCountryCode.
  • Result: The two-letter country code (e.g., "US") for the selected country will be stored in the shippingCountryCode variable, which can then be used to query shipping costs.

Example 3: Managing Task Status

  • Scenario: In a task management application, users can update the status of a task using a dropdown (e.g., "To Do", "In Progress", "Completed"). Each status has an internal code (e.g., "TODO", "INPROG", "DONE"). When a user changes the status, you want to record the internal status code in a log or update a database record.
  • Inputs:
    • UI element: Select the "Task Status" dropdown field.
    • Code: Specify a variable name, for example, currentStatusCode.
  • Result: The internal status code (e.g., "DONE") of the newly selected task status will be stored in the currentStatusCode variable, allowing your application to accurately track and process task updates.