Skip to main content

I am new to Trailhead/Salesforce and am Currently in the Admin Intermediate > Flow Builder Module

 

"To create multiple records, you must use the values from a record collection variable. Earlier in the flow, populate the record collection variable with the new records' field values. For each record that's created, the flow stores the ID of the created record in the ID fields of the record collection variable.

To create one record, you have two options for setting the record's values.

  • If you've populated a record variable with the field values for the new record, choose to set the record fields by using all the values from a record variable. Then select the record variable or record collection variable to use. When the record is created, the flow stores the ID of the created record in the record variable's ID field.
  • To manually map values from various resources in the flow, choose to set the record fields by using separate variables, resources, and literal values. The ID of the created record is automatically stored for you. Optionally, you can manually store the ID of the created record in a Text variable, by selecting Manually assign variables (advanced).

Here's a comparison of what the Create Contact element in the New Contact flow looks like for each option."

2 respostas
  1. 26 de ago. de 2022, 07:15

    To add onto that, when you're creating a single record you can do it one of two ways:

    1. You can create a record variable, assign values to its fields using an Assignment element, and then create that record using a Create Records element
    2. You can create the record directly from a Create Records element (without creating a record variable first) if you've already got all the data you need to fill in its fields from other resources in the Flow.

    These 2 items are what the two separate bullet points in the text you posted are saying.  Hopefully that makes it a little clearer.

     

    The above is all if you're creating ONE record at a time.  Creating multiple records at once requires you to use a collection variable, which is a little more complicated.

0/9000