0

Using Flow, I am trying to capture all the records of an object (A) and use selected fields to populate a new object that I am creating (B).

  1. I am using a record collection variable to capture all the records from (A) with the 'Get Records' element.
  2. I have populated 3 selected variables with fields from the Record Collection Variable (A)
  3. Then I use the Create Records element to create 'Multiple' records in (B) with the same Record Collection Variable.

It doesn't prompt me for individual variable names and the records do not create. I may not be capturing the records also.

Please see the screen shots.

enter image description here

enter image description here

enter image description here

  • Are my screen shots visible? – Boots Apr 3 '19 at 4:37
  • No, we cannot see screenshots – Anita Bhanarkar Apr 3 '19 at 5:04
0

Based on your screenshots, it appears to me that you're passing the results of your Get Records element directly into Create Records. Even if this worked, I don't think it's going to do what you want, but the core problem seems to be that your sObject collection variable contains Ids from the queried records.

Your screenshot shows

For each item in the collection, make sure the ID is blank.

In the Fast Create element documentation, there's the same injunction with some additional detail:

The sObject variable or collection that you want to use to create the record or multiple records. The object types must match, and each ID field must not have a value.

Emphasis mine. Here, additionally, the object types do not match; the records in your collection variable aren't the same as the type you wish to create.

I think you'll need to create a second sObject collection variable, and then loop over your collected records to create new records of the type you want. Within the loop, you'd populate each new record with the fields you've chosen from the source sObject - which would not include their Ids, so those new records would have their Id field blank as the system expects. They'd also be of the correct sObject type.

Then, you'd pass that second collection to Create Records.

| improve this answer | |
  • I see many references to 'make sure the ID is blank'. I don't see how to initialize that field in the declarative Flow process. The ID field doesn't show up in any prompts or options (as do other fields). I'm sure it's a simple maneuver, but I haven't discovered it. Help.... – Boots Apr 3 '19 at 15:50
  • @Boots You'd create new sObject variables, which will start with the Id field blank because they have not been inserted in the database. – David Reed Apr 3 '19 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.