function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LloydSLloydS 

Creating Multiple Child Records in a Flow

In a flow, I want to present the user with a multi-select checkbox field that displays a list of filtered accounts.

 

I have two custom objects - Object A and Object B. Object B has a master-detail relationship to Object A and to the standard Account object.

 

I'd like the flow to be able to create multiple Object B records - one for each of the accounts selected in the multi-select checkbox. So if Accounts A, B, and C are checked, then three Object B records are created with a master-detail relationship to those accounts as well as to Object A (which would be selected separately).

 

What is the best way of accomplishing this?

 

I don't think there is a simple solution. I could place a limit on how many accounts are selected if necessary but ideal that would not be a limitation.

DarrellDDarrellD

You can't do iterations directly yet in Flow so if you want to stay native only thing I can think of is a record create for each checkbox item and they line up in a linear fashion. But when one isn't selected you'd want the error to point to next create so it keeps moving along.

 

This is ugly since you can't really handle errors and have to have a create for each option.

 

Since you can also do Apex plugins you can certainly use those to better accomplish this.

 

Darrell