ProTip: Dynamically Change the Background Color of Form Fields Based On A User’s Group Membership

Dynamically change the Background Color of fields based on Group Membership

Utilizing the Background Color property (located in the Properties panel in the Template Editor) is an easy way to make your digital forms more intuitive for end-users. The Background Color of your fields can not only be changed to whichever color you wish but can also be made dynamic. This means that a field’s Background Color can change in response to input data or even which user has generated a form. 

Using Dynamic Field Properties (DFP) and the ISINGROUP function, different form fields can change color when a user generates a new form, based on their Group membership. This is incredibly useful, as users often have different responsibilities within the same forms. 

What is a Group

Groups are a collection of users who share similar responsibilities and use the same digital forms. Permissions are assigned at the Group level and dictate how much access a user has to your GoFormz account, for example, the ability to delete forms, reopen completed forms, access specific templates, and more. 

For this use case, we’ll be utilizing Groups to determine what fields should change their Background Color when a new form has been generated.  

What is the ISINGROUP function? 

The ISINGROUP function can be applied to a variety of fields, to dynamically change how they display or operate, based on the user’s Group

Use case example: changing the color of important form fields
Imagine you are a supermarket manager tasked with collecting regular safety inspections from each department’s supervisor. Any supervisor can generate and fill out these inspections, but they only need to fill out the sections relevant to their department. 

As the manager tasked with digitizing these inspections, you can use Dynamic Field Properties (DFP) and the ISINGROUP function to change the Background Color of only the fields members of a specific Group are responsible for. For example, if a user were a member of the Group ‘Produce’, only the fields they were responsible for would change color. If a supervisor from the ‘Pharmacy’ department were to open that same inspection, whichever fields the pharmacy team is responsible for would be highlighted yellow. 

How to use ISINGROUP to change the Background Color of form fields based on a user’s Group membership: 

1. Login to GoFormz from a computer and open the Template of the form you would like to edit. 

2. Select the field you would like to make dynamically change color for a specific Group. For this example, we’ll select a Text field. 

Inspection form in Template Editor displaying a section for the pharmacy department to complete

3. Navigate to the Properties panel, to the right of your form Template, and locate the Background Color property. Click the ellipses icon [...] to the right of the Background Color drop down and select ‘Use a custom calculation’. 

A GoFormz group ID number

4. Enter the following calculation, =IsInGroup("GROUPID") and replace “GROUPID” with the appropriate Group ID number. For this example, we’ll change the Background Color of several of our fields to yellow if the user is a member of the ‘Pharmacy’ Group. If the ‘Pharmacy’ Group ID number was ‘098f311e-a398-4c0e-9697-a1ea0135b204’, the calculation would look like =IsInGroup("098f311e-a398-4c0e-9697-a1ea0135b204"). You can find the Group ID by clicking into the Group and copying the ID number from the URL. 

5. Click ‘Save Changes’. 

Fields dynamically highlighted yellow in the form editor

Now, when users from different departments generate or open an inspection form, only the fields they need to complete with be highlighted yellow. 

This same use case can be applied to make the Required and Visible fields dynamic. To learn more about using Dynamic Field Properties to make your digital forms even more powerful and intuitive, check out this blog post