How to Use Record Choice Set in Salesforce Screen Flow

In Salesforce, the Record Choice Set refers to a collection or set of records that can be used as options within a picklist field on an object. In this Salesforce tutorial, we will learn to use and create a Record Choice Set in a Salesforce Screen Flow.

Use Record Choice Set in a Salesforce Screen Flow

In this scenario, we will create a Screen flow to create an Opportunity record. In the screen flow we will create a flow Resource Record choice set for the Opportunity Accounts.

To create the Screen flow, navigate to the Salesforce Setup page and follow the below steps.

1. On the Setup page, go to the Quick Find box, search, and select Flows under Process Automation.

2. In the Flows setup window, click on the button New Flow.

3. Select the option Screen Flow and click the Create button.

How to add a Record Choice set in Salesforce screen flow

4. Add a Screen element to the flow and enter the Label and API Name for the Screen element.

Use Record Choice Set in a Salesforce Flow

5. Add the text component to the screen region and label it as Opportunity Name.

How to create Record Choice set in a Salesforce Flow

6. Add a Date Component to the screen and label it as the Close Date.

Add a Record Choice Set in a Salesforce Screen Flow

7. Add a Picklist component to the screen and label it as a Stage Name; then, in the Choice field, click on New Choice Resource.

How to use a Record Choice set in a Salesforce flow

8. Enter the below fields for the resource of the picklist Stage Name.

  • Enter the Resource Type as Picklist Choice Set.
  • Enter the API Name as Opportunity_Stage and Object as Opportunity.
  • Select the Data type as Picklist and Field as Stage Name.
  • At last, click Done.
Create a Record Choice Set in a Salesforce Screen Flow

9. Now again, add a Picklist field to the screen and label it as Account Name. In the Choice field, click on New Choice Resource.

See also  Migrate Workflows and Process Builder to Salesforce Flow

10. Enter the below fields for the new resource to create a Record Choice set.

  • Select the Record Type as Record Choice Set.
  • This record set will consist of Account records, so I have entered the API Name Opportunity_Account.
  • Select the Object as Account.
  • In the choice set, to display the active accounts I have selected field as Active_C, Operator as Equals, and Value as Yes. This condition will display only active accounts.
Record Choice Set in Salesforce Screen Flow

11. Scroll down to the section Configure Each Choice and select the Choice label as Name, Data Type as Text, and Choice Value as ID. After this, click on the Done button.

Use Record Choice Set in a Salesforce Screen Flow

12. Now add a Create Record element to the flow. After this, enter the Label and API Name.

Under the heading, How to set the Record Fields, select the option Use separate resources and literal values. Then, in the Object field, select Opportunity.

Create a Opportunity with Screen flow using record choice set

13. In the section, Set Field Values for the Opportunity, map the below fields with their values.

FieldValue
AccountIdAccount_Name
CloseDateClose_Date
NameOpportunity_Name
StageNameStage_Name

An opportunity record typically has a lookup relationship with an Account record. This relationship is defined by the AccountId field on the Opportunity object, which stores the ID of the related Account.

How to add a Record Choice set to a Screen flow in Salesforce

14. Now save the flow by entering the Flow Label and Flow API label, then click Save.

How to use Record Choice Set in a Salesforce Screen Flow

Now, the Screen flow is created with a Record Choice Set to create an opportunity record.

Test and Debug the Screen Flow

Follow the below steps to test and debug the created screen flow.

See also  How to Create a Related Record from a Salesforce Flow

1. Click on the Debug button at the top.

Flow Resource Record Choice Set in Salesforce

2. In the Debug Flow window, click on the Run button.

Flow resource Record Choice Set in a Salesforce Screen Flow

3. Enter the opportunity details in the fields. Here, In the field Account Name we can see the record choice set of the opportunity accounts.

After entering the fields, click Next.

Flow resource Record Choice Set in Screen flow

4. Now, if the flow runs successfully, it will create an Opportunity record.

5. Navigate to the Opportunity tab, and there you will see the record that is created with the screen flow.

As we can see, the record is created with the screen flow in which we have used the Flow Resource: Record Choice Set.

This way, we can follow the above steps to add and create a flow resource Record Choice set to the Salesforce screen flow.

Conclusion

In Salesforce, a Record Choice Set in Screen Flow allows users to select specific records, which appear according to the criteria applied.

By following the above steps, you might have understood the process of creating a record choice set flow resource and using that record choice set in the screen flow.

You may like to read: