How to Use the Repeater Component in Salesforce Screen flow

In this Salesforce tutorial, we will learn about the Repeater Component in Salesforce screen flow.

In the Salesforce Spring ’24 release, a new Repeater component was launched specifically for the screen element. This component is helpful in creating multiple records in a single-screen flow interview.

Salesforce Repeater Component

In Salesforce flows, the Repeater component collects information about multiple records of the same type on a screen flow. It allows the repetition of a set of fields in a single-screen element.

This component simplifies creating multiple records in a single screen flow operation. For example, you create Contact records using screen flow. For that, you input data in the fields displayed on the screen flow, and to add another contact record, you need to run the flow again.

Using the Repeater component, the set of fields can be added multiple times. After entering the fields, when we run the flow, it will create multiple records.

Use the Repeater Component in Salesforce Screenflow

Now, using an example, we will create a Screen flow using the repeater element, and with this screen flow, we will create Opportunity records.

To create the screen flow, navigate to Salesforce’s setup page and follow the steps below.

1. On the setup page, search for and then select flows in the quick find box to navigate to flows setup.

Create a screen flow using repeater component in Salesforce

2. In the flow setup, click on the New Flow button.

3. Select the option Start the flow from scratch and click Next. In the next window, select the option Screen flow and click the Create button.

How to use the Repeater component in Salesforce flow

4. To get Opportunity details from the user, add a Screen element to the flow.

Create records using repeater component in the Salesforce flow

5. Enter the Label for the screen element, then add the Repeater component to the screen and enter the API Name for the repeater element.

Salesforce Screen flow Repeater Component

6. Within the Repeater component, add the Text component to input the Opportunity Name, then add the Date component to the Close date field.

You can add the Picklist component for the Opportunity stage field.

The repeater component will only repeat the fields that are inside it.

Salesforce Screen flow Repeater Component to create records

8. The repeater component will give output as a collection of Opportunity field values that it contains. We need to add a Loop element to loop through the output and then use an Assignment element to assign the values to an Opportunity record variable.

Add a Loop element to the flow and select Collection Variable as Screen details ( screen name) > Repater (repeater API Name) > All Items.

Then, in the Direction, select First Item to Last Item.

Add a repeater component in Screen flow Salesforce

9. Now, create two New Resources for the Single and Collection record variables, that we will use in the Assignment element.

  • For the single record variable, enter the API Name. Select the Data type as Record and Object as Opportunity, then click Done.
Salesforce Flow repeater element
  • For the Collection record variable, enter the API Name. Activate the checkbox Allow Multiple values.

Select the Data type as Record and Object as Opportunity, then click Done.

Use a repeater element in the screen flow

10. Add an Assignment element inside the loop. Enter the Label and API Name for the element then map the variables and values in the following way.

Here, Opportunity_recordvar is a single variable, and Opportunity_collectionvar is a Collection variable.

VariableOperatorValue
Opportunity_recordvar > NameequalsOpportunity_Name (text)
Opportunity_recordvar > Close dateequalsClose_date (date)
Opportunity_recordvar > StageequalsOpportunity_stage (picklist)
Opportunity_collectionvaraddOpportunity_recordvar
Add a Repeater component in Salesforce flow

11. Add a Create Record element outside the loop. Enter the label and API Name for the element.

In the section How many records to create, select the option Multiple. In the field Record Collection, select the collection variable we created in the above steps.

Create multiple records with Repeater in Salesforce flow

12. Click on the Save button in the flow builder. Enter the Flow Label and Flow API label in the next window, then click Save.

The Screen flow is created with the Repeater component on the screen. In the next steps, we will test and debug the flow.

Test and Debug the Screen flow

To test and debug the flow, follow the steps below; before that, make sure that you have saved your flow.

1. Click on the Debug button in the Flow Builder.

Salesforce use repeater component in the screen flow

2. In the debug window, click on the Run button.

3. Enter the details of the fields in the screen flow, and to add another record, click on the Add button.

As we click the Add button, the repeater component will display another set of fields to create a record.

After entering the record fields, click on the Next or Finish button to complete the flow button.

Create records using repeater component in the Salesforce screen flow

4. Navigate to the object tab for which you created the records through screen flow. The records will be visible in the list view, as shown in the image below.

Repeater Component in Salesforce screen flow

The records are created, which means the Screen flow ran successfully. After this, you can Activate the Screen flow to deploy it on the Records pages.

This way, we add and use the Repeater component in Salesforce screen flows by following the above steps.

Conclusion

In Salesforce screen flows, using the repeater component allows the creation of multiple records through a single screen flow.

You might have understood how we can add and use the Repeater component in the Salesforce screen flow by following the steps.

You may also like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.