Skip to main content
All CollectionsTips, tricks and troubleshootingUser case-specific guides
Show dynamic options of Single section control in Approval forms based on user groups
Show dynamic options of Single section control in Approval forms based on user groups

Learn how to customize Yeeflow approval forms with dynamic Single Select controls that change options based on the user's group.

Updated over 8 months ago

Introduction

In business processes, it's common to have forms that need to adapt based on the user's role or group. Yeeflow's flexibility allows for dynamic form adjustments, enhancing both the efficiency and relevance of data collection. This guide focuses on creating dynamic options for a Single Select control in a Yeeflow approval form, based on the user group of the current user.

Business Scenario

Imagine an organization with three distinct user groups. The requirement is to present different Single Select options to users based on their group membership:

  • User Group A: Can select options 1, 2, 3

  • User Group B: Can select options 4, 5

  • User Group C: Can select options 2, 4

Given that the Single Select control doesn't natively support dynamic options based on user group membership, a creative solution is necessary.

Solution Overview

To achieve this dynamic functionality, you can create three separate Single Select controls, each with a set of options specific to a user group. By utilizing Yeeflow's dynamic display rule settings, you can control which Single Select control is shown to the user based on their group membership. Crucially, all three controls will be associated with the same variable, ensuring data consistency and ease of data management.

Step-by-Step Guide

Opening and Setting Up the Initial Single Select Control

  1. Open Your Approval Form: Begin by navigating to the Yeeflow approval form you wish to edit. Once there, enter the form designer to start the customization process.

  2. Locate and Add the Single Select Control: In the form designer, look for the Single Select control within the left-hand controls panel. Drag this control onto your form in the desired location.

  3. Customize the Variable ID and Name: Once the Single Select control is placed, customize its associated variable. For this demonstration, set the variable ID to field_Dynamic and the variable name to Select Options. These settings will be crucial for dynamically displaying the correct options based on the user group.

  4. Add Initial Options: Navigate to the Choice settings section of the Single Select control. Here, input Option 01, Option 02, and Option 03 as the choices available for this control. These options will be visible to the first user group.

Duplicating the Control for Additional Options

  1. Copy the First Single Select Control: Right-click on the Single Select control you've just set up. From the pop-up menu, select "Copy" to duplicate the control.

  2. Paste the Copied Control: Right-click again on the form designer area and choose "Paste" from the menu.

    When a confirmation window appears, opt for "Continue with existing variables."

    This action ensures the newly created control is linked to the same variable as the first, maintaining data consistency across user groups.

  3. Configure Options for the Second User Group: Select the newly pasted Single Select control. Expand its Choice settings and update the options to Option 04 and Option 05. These will be the choices available to the second user group.

Creating a Third Control for Another Group

  1. Duplicate the Second Single Select Control: Right-click on the second Single Select control (with options 4 and 5). Click "Copy," then right-click on the form designer space and select "Paste," once again choosing "Continue with existing variables" from the confirmation dialogue.

  2. Set Options for the Third User Group: For this third control, modify the options within the Choice settings to Option 02 and Option 04. These options are designated for the third user group.

To ensure that your Yeeflow approval form dynamically adapts to user group membership, configuring the dynamic display rules for each Single Select control is essential.


Configuring the First Single Select Control

  1. Select the First Single Select Control: In the form designer, click on the first Single Select control you've created.

  2. Access Appearance Settings: Expand the "Appearance" settings group for this control.

  3. Open Dynamic Display Rules: Scroll to the bottom of the settings panel and click on the "Dynamic display rules" button.

  4. Enter Expression Editor: In the rules pop-up window, click the expression icon to launch the expression editor window.

  5. Insert isInGroup Function: Click the function button on the top toolbar of the expression editor. Search for the isInGroup function in the list, and click the "Insert" button to add it to the editor.

  6. Specify First Parameter (Current User):

    • Click the "Expression" button on the top toolbar.

    • Navigate to "Context" and then "Current user".

    • Click "Insert" to add it as the first parameter of the isInGroup function.

  7. Set Second Parameter (User Group):

    • Click the "Expression" button again.

    • Choose "User group", then select the appropriate user group name that should see this first Single Select control.

    • Click "Insert" to add this as the second parameter.

  8. Finalize Rule and Show Control: Click the "OK" button to close the expression editor. In the "Action" dropdown list of the dynamic display rules window, select "Show".

    Click "OK" to complete the setup.

Repeat Steps for Additional Single Select Controls

  • For the Second and Third Single Select Controls: Follow the same process to configure the dynamic display rules. The key difference will be in step 7, where you select a different user group as the second parameter of the isInGroup function for each control. This differentiation ensures that each control is shown only to its corresponding user group, based on your initial setup.

Save and Test Your Configurations

Saving Your Form Configurations

  1. Review Your Changes: Before saving, take a moment to review all the changes and configurations you've made to the Single Select controls and the dynamic display rules. Ensure that each control is correctly set up to display based on the designated user group.

  2. Save Your Form: Locate the "Save" or "Publish" button in the Yeeflow form designer interface. Click it to save all the changes you've made. This action ensures that your dynamic display rules and other configurations are stored and will be applied to the form.

Testing Your Form

Testing is a critical phase that should not be overlooked. It's important to verify that each user group sees the correct Single Select options as intended. Follow these steps to conduct a comprehensive test:

  1. Test with Different User Accounts: Log in to Yeeflow with user accounts from each of the specified user groups. Access the form with each account and observe the Single Select options that appear. Ensure that the options match the configurations you've set for each group.

  2. Verify Dynamic Display Rules: As you test the form with different user groups, pay close attention to the dynamic display rules' effectiveness. Each Single Select control should only be visible to its respective user group, as configured in the dynamic display settings.

  3. Check for Consistency Across Devices: If possible, test the form on different devices and browsers to ensure that the dynamic display rules work consistently, regardless of the user's device or browser choice.

  4. Gather Feedback: Consider gathering feedback from users within each group to understand their experience. This feedback can be invaluable in identifying any issues or areas for improvement.

Troubleshooting and Adjustments

  • If you encounter any issues during testing, such as controls not displaying as expected, revisit the form designer and check your dynamic display rules for accuracy.

  • Make necessary adjustments based on user feedback and retest until you achieve the desired behavior and user experience.

Conclusion

By carefully saving and thoroughly testing your configurations in Yeeflow, you can ensure that your approval form dynamically adapts to different user groups, presenting a tailored and efficient interface for each. This level of customization not only enhances the user experience but also streamlines the data collection process, making your forms more effective and user-friendly. Remember, the key to successful form deployment lies in meticulous testing and a willingness to refine based on feedback.

Did this answer your question?