How to use a Fast Create

The first time I saw Fast Create I was quite confused.  Is a Record Create slow?  Well, it is actually slower if you want to create multiple records at once.  A Fast Create really is more than just one element.  This is because you must build records to put in a SObject Collection Variable that you will then insert with your Fast Create.  If you’re new to this element, you’re probably wondering what the heck I am talking about.  Lets go over our use-case and then we will make sense of this madness.

The business case for this example is that we want to find all of the Opportunity Line Items (OLI) on an Opportunity that was just marked as Won.   We want to push all Line Items over as Assets on the Account associated to the Opportunity.  You might be saying you can do that in a Record Create? Well, did you know Salesforce has a Limit of 50 DATA Elements in one Flow?  That means, if you’ve got a sizable list of products on an Opportunity, a User might break your Flow!  We can actually utilize Assignment Elements to create the records and pass them into our Fast Create.  This means we would be using just one create, just like if you were doing a Data Import with Workbench or Dataloader.  Pretty powerful, right?  So lets get started!

If you have not yet read Fast Lookup and  Loops, you might want to take a look at them.  This post is focused on how we get our Fast Create to work, and not so much how we query or loop through the records.  I will be showing the ‘finished’ Fast Lookup and Loop so that you have it as reference in terms of what Variables were used.

OLI Fast Lookup

Loop OLIs

So, how do we add records into a SObject Collection Variable?  This was one of the hardest parts for me to understand.  It took a while before it clicked.  Hopefully this will be basic enough that you’ll not have the same issues I had when building your first Fast Create.  So lets get started by adding in our First Assignment Element into our Flow!

Drag in the Assignment 1

In our first Assignment Element we have created an SObject Variable (New_Asset), and we are assigning the fields in that variable values based on static values (AccountId associated to the Opportunity and a Status of Purchased), as well as dynamic values from the existing Opportunity Line Item that we found in our Fast Lookup and are Looping through (SObject Variable – Existing_OLI).

SObject Variable - New Asset

SObject Variable - Existing OLI

In our second Assignment Element we are adding the SObject Variable we just created to our new SObject Collection Variable that we are going to use in our Fast Create.  If you’re used to doing data loads, think of this as adding a row to an excel sheet.  Every time you are looping through an Opportunity Line Item record we are transforming the data (as you saw in the previous element) and adding it as a row in our collection of Assets for the Fast Create (as you see in this element).

Drag in the Assignment 2

SObject Variable - Adding Part 1.

SObject Variable - Adding Part 2

Now we need to finish this by dragging out the Fast Create element (under the DATA section of the Palette).

Find Fast Create

Fast Create Variable Added

Set your SObject Collection Variable to be the Variable in your Fast Create and you’re done!   Take a look at what the finished Flow looks like:

Fast Create Flow

RECAP:  Fast Create elements let you create a batch of records in your Flow. I like to think of the process as adding rows to an Excel sheet.  Every time I go through my Loop, I am adding an additional row to the Excel sheet.  My columns are the what I set in the first Assignment element.  This means if you want to include a field you must assign it.  This ‘final’ Excel sheet will be what I am going to insert into Salesforce.  So, a Fast Create is like doing an insert of records in Workbench or Dataloader.

11 thoughts on “How to use a Fast Create

  1. meghan March 25, 2016 / 3:19 am

    Do you know if there is documentation somewhere for the following example: you are using a fast create to create multiple opportunity records related to the same account, but each record needs to have a different close date based on the date the user selects. and you want the user to be able to enter a different amount. I’d think you’d use a screen, but how do you ensure the correct close date gets put into each record?

    Like

    • David Litton March 25, 2016 / 3:02 pm

      Meghan, I don’t currently have anything on my site that explains that exactly… however, it would just be a field you add in your first Assignment element for the Opportunity. If you wanted to make it automated based on the TODAY() date, you could increment it 30 days or something. Or do you want it to be user entered?

      Like

  2. Nico July 26, 2016 / 6:27 pm

    Hello! I’m having an issue with a Fast Create where my Flow is only creating one record, even though it should be looping through three. Any idea where I should look for my mistake? I’m stumped right now. I am not getting any error message when my flow is run, it just creates one record instead of three.

    Like

    • David Litton July 26, 2016 / 7:00 pm

      Nico, I’ve sent you an email, we can troubleshoot there.

      Like

  3. Matt August 15, 2016 / 4:19 pm

    Hi,

    I am working on a custom button (on Opportunity) that would launch a flow to create 12 child records in the custom (Fee__c) object. I would also like to rank their names: “[Opportunity.name] Fee 1/12”.

    How do I limit fastcreate to 12 records only? and how do I assign different names to newly created records?

    Regards,

    Matt

    Like

    • David Litton August 17, 2016 / 3:30 pm

      Hey Matt,

      What you want to do is add in a variable that you can add 1 to every time you go through your Loop. You’ll want to use a decision at the end of inside your Loop to exit the Loop and proceed to your next element.

      Let me know if you need more help on that. I think I’ll add that concept as a post in the near future.

      David

      Like

      • Matt August 23, 2016 / 8:58 am

        Hi David,

        I tried the above, but am not very successful. I think an ilustrated version would come handy for many.

        Regards,

        Matt

        Like

  4. Kelly October 19, 2016 / 9:29 pm

    Hi, David-

    I’m trying to create a flow very similar to your example here (same process, just different objects) and keep getting an internal server error anytime I run it. Any ideas off the top? Very happy to send more details and screenshots if you have time/desire to help me troubleshoot.

    Thanks for the great post; I certainly feel like I’m closer to the solution than I was before finding this!

    Like

    • David Litton October 24, 2016 / 1:39 am

      Kelly,

      I’ve sent you an email, we’ll sync via email on looking to help you troubleshoot this.

      Thanks,
      David

      Like

  5. Hassan October 28, 2016 / 10:20 am

    This is so amazing, im so grateful the effort you put in david.
    Its such a shame Salesforce guides are pretty much non existent on this topic, which is suprising considering how powerfull they are. SF guides are pretty hard to follow and examples dont have much explanation.

    A fast create is exactly what im trying to do, but im stuck. I wasnt aware you had to assign those values. The process is quite confusing. Hopefully I can follow these guides and do it.

    Any chance of a video of these david?
    Thansks so much again.

    Like

    • David Litton November 5, 2016 / 6:31 am

      Hassan,

      Thank you for the kind words, I am happy to hear that it has been helpful to you.

      A video has been something I’ve been debating for quite a while. I’m not going to say yes just yet… but I do plan on having a Fast Create ‘part 2’ post in the future, as it is a hot topic for many people (and was one of the harder areas of Flow for me to learn).

      Like

Leave a comment