I have a flow where I've looked up and looped through service contracts and looked up and looped through contract line items storing sobject variables which I've placed into a collection. I then create opportunities with the info I have from service contracts.

I have 2 questions:

  1. I want to check if the way I'm getting the newly created oppty ids is the only way or if I'm missing something. I do a fast lookup on opptys looking for an id I save on the opptys as I create them. I then loop thru the collection and save the ids as sobject variables which I add to a collection.

  2. Is is possible to add a sobject variable to a collection and later in the flow add more data to the same sobject variable and then add that data to the same collection without overwriting the variables gathered?

In my case, I use the same collection to collect the newly created oppty ids and to which also had other sobject variables added but when I attempt to fast create the oppty line items it does not work, stating that info I verified with screens earlier is not present

Hope that makes sense! Top half of the flow

Second half of the flow

  • Are you able to provide a screenshot of your flow? Commented Sep 11, 2014 at 8:19
  • @AlexTennant I've just added screenshots
    – Marchandoj
    Commented Sep 11, 2014 at 11:13
  • If you add the additional data later, you're doing an update, not a create. That may be the source of the problem you're having. If you're trying to reuse your code, you'd be overwriting what's already there rather than adding to it via say an upsert.
    – crmprogdev
    Commented Sep 13, 2014 at 14:50
  • Were you able to find an answer to this? Commented Nov 22, 2016 at 10:56
  • @willem Mulder see below, just posted an answer
    – gorav
    Commented Jan 13, 2017 at 12:58

1 Answer 1


Once you insert a sObject collection, you should be able to access the record IDs in the collection itself.

To demonstrate, add a screen element and display the sObject collection that you just inserted. You will see a list of opp IDs.

Screenshots below for a sample flow that creates two account sObject variables, adds them to a collection, and inserts the collection. You can see that prior to the insert, if you display the sObject collection, it just shows a commma. After the insert, you see the two IDs.


flow overview

sObject collection before insert

soc before insert

sObject collection after insert

soc after insert

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .