ScreensScreen Components

Checkboxes

Creating checkboxes within Descope flows is greatly important when you may display a terms and conditions checkbox or an "opt-in" checkbox for marketing messages. Descope allows you to create these checkboxes and track the answer on the user's details using custom attributes. This guide will cover how to implement a checkbox within your flow.

Create the Custom Attribute

The first step to configure checkboxes within your flow, you must create a boolean custom attribute. To do this, navigate to the custom attributes screen within the Descope console. Click the + Create Attribute button at the top right, and configure the attribute as you wish. For this example, we will create an email marketing opt-in checkbox.

Create a custom attribute to use as a checkbox within your Descope flow

Utilize Checkbox within Descope Flow

Add a Checkbox to the Flow

Now that you have created the custom attribute, navigate to the flows screen within the Descope console, select your desired flow, then select the screen within the flow you want to add the checkbox to.

Once on the screen you'd like to add the checkbox to, scroll down on the left and find your custom attribute, then drag the attribute where you'd like it on the flow screen. Once you've added it to your flow screen, you can change the text of the checkbox by editing the label as shown below.

Adding a checkbox within your Descope flow

Additional thing to be noted, there is also a generic boolean input component on the screen builder that you could use to build into your screen. This component is similar to the one created above for a custom attribute. You can change its configuration including the label, its type (checkbox or a switch button), direction, size, fill container, mandatory. This component also allows defining the context key in which the value will be stored.

Adding generic boolean component within your Descope flow

Update the User within the Flow

After you've added your checkbox to the flow, you will need to add a Update User/Properties action to the flow by clicking the blue + sign at the top left and searching for the action. You can then configure the action to store the data captured from the user during the flow per the below configuration. Once the action is configured connect it to the flow after the screen with the checkbox.

Configure update user action to update the user's checkbox selection within your Descope flow

User Details Post-Flow

Once the user has ran through the flow, if they select the checkbox, it will be stored on the user as the flag being selected. In the user table, custom claims (if configured), and user details returned from the API or SDK it will be shown as true.

User details after being updated using a checkbox within Descope Flows

Was this helpful?

On this page