Get value of color field
Function: Get value of color field
This function allows you to retrieve the color currently selected in a "Color Input Field" component on your application's form. Once retrieved, this color value is stored in a variable, which you can then use in subsequent actions or display elsewhere in 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 select a component that is a "Color Input Field".
Output
- Answer: This is the name of the variable where the selected color value will be stored. For example, if you name it
chosenColor, then after this action runs, thechosenColorvariable will hold the color code (e.g.,#FF0000). By default, this variable will be namedINPUT_FIELD_ANSWER.
Execution Flow
Real-Life Examples
Example 1: Displaying a selected color
- Scenario: A user selects a color using a Color Input Field, and you want to immediately display that color in a text label or change the background of another element.
- Inputs:
- UI element:
MyColorPicker(assuming this is the ID of your Color Input Field) - Answer:
chosenColor
- UI element:
- Result: The action retrieves the color selected in
MyColorPicker(e.g.,#0000FF) and stores it in a variable namedchosenColor. You can then usechosenColorto update a text label or another UI element to show the selected color.
Example 2: Using a selected color in a conditional logic
- Scenario: You want to check if the user has selected a specific color (e.g., red) and perform an action based on that choice.
- Inputs:
- UI element:
ProductColorSelector - Answer:
selectedProductColor
- UI element:
- Result: The action gets the color from
ProductColorSelector(e.g.,#FF0000) and saves it to theselectedProductColorvariable. You can then add a condition likeIf selectedProductColor is equal to "#FF0000" Then...to trigger further actions, such as showing a "Limited Stock" message.
Example 3: Saving a user's preferred color to a database
- Scenario: A user sets their preferred theme color using a Color Input Field, and you want to save this preference to their user profile in your database.
- Inputs:
- UI element:
UserProfileThemeColor - Answer:
userThemeColor
- UI element:
- Result: The action fetches the color from
UserProfileThemeColor(e.g.,#FFA500) and stores it in theuserThemeColorvariable. You can then use another action (e.g., "Update Record") to save the value ofuserThemeColorinto the user's profile in your database, ensuring their preference is remembered.