Ask AI
Skip to main content

Get value of color field

Function: Get value of color field

This action allows you to retrieve the color selected by a user in a "Color Input Field" on your application's form. Once retrieved, this color value (represented as a text code like '#RRGGBB') is stored in a variable, making it available for other actions or logic within your application.

Input

  • UI element: This is the specific "Color Input Field" component on your form from which you want to get the selected color. You must choose an existing Color Input Field from your application's design. It's crucial that the selected UI element is indeed a Color Input Field.
  • Variable Name to Store Result: This is the name you give to the variable where the selected color will be stored. If you don't provide a name, it will default to INPUT_FIELD_ANSWER. This variable will hold the color as a text string (e.g., "#FF0000" for red).

Output

This action successfully retrieves the color value from the specified "Color Input Field."

  • Stored Color Value: The selected color (e.g., "#FF0000") is stored as a STRING in the variable you named in the "Variable Name to Store Result" input. This variable can then be used in subsequent actions.

Execution Flow

Real-Life Examples

Example 1: Personalizing a User Profile

Imagine you have a user profile page where users can select their preferred accent color for the application interface.

  • Inputs:
    • UI element: User_Preferred_Color_Field (a Color Input Field on the user's profile settings page)
    • Variable Name to Store Result: preferredUserColor
  • Result: The color selected by the user in the User_Preferred_Color_Field (e.g., "#0000FF" for blue) is stored in a variable named preferredUserColor. This variable can then be used by another action to update the user's profile in the database or apply the color to UI elements.

Example 2: Dynamic Theme Adjustment

You want to allow administrators to quickly change the primary theme color of your application from a settings panel.

  • Inputs:
    • UI element: Admin_Theme_Color_Picker (a Color Input Field on an application settings page)
    • Variable Name to Store Result: selectedThemeColor
  • Result: The color chosen by the administrator in the Admin_Theme_Color_Picker (e.g., "#FFC0CB" for pink) is saved into the selectedThemeColor variable. This variable can then be used by another action to dynamically change the background color of a specific section or the entire application, providing instant visual feedback.

Example 3: Product Customization Preview

On an e-commerce product page, customers can customize an item by choosing its color, and you want to show a live preview.

  • Inputs:
    • UI element: Product_Color_Option (a Color Input Field on a product customization page)
    • Variable Name to Store Result: chosenProductColor
  • Result: The color selected for a product (e.g., "#008000" for green) from the Product_Color_Option field is stored in the chosenProductColor variable. This variable can then be used to update a preview image or text to reflect the user's color choice before they add the item to their cart, enhancing the shopping experience.