Newer Version Available

This content describes an older version of this product. View Latest

Create Custom Component for Guest User Flows

Allow flows for your Experience Cloud guest users to provide alternative user registration screens, complex decision trees, and conditional forms to gather user information. The following example uses the Site Class API. For more information, see “Site Class” in the Salesforce Apex Developer Guide.

1. Create a Custom Aura Component

Using Guest User Flows for login or self registration requires a custom component that implements lightning:availableForFlowScreens.

Here’s the sample code for a simple data collection preferences flow.

Controller file:

Design file:

2. Create an Apex Class

The following example creates a class, CommunitySelfRegController, which is used with your Aura component to register new Experience Cloud site users.

Adding self registration with a flow requires the following:

  • The UserPreferencesHideS1BrowserUI preference should be set to True. This prevents the mobile UI from defaulting to the Salesforce Mobile App interface rather than your Experience Builder site.
  • CommunityNickname is required and must be a unique value.
  • The self registration preference should be enabled in your site with a valid profile and account.

Note