Skip to main content

I’m running into a wall with an autolunched subflow designed to process over 2,000 retail store records.

What the flow is doing:

1. Iterating over a collection of input stores via a Loop element.

2. Passing each item through an Assignment block (varRSSA.Retail Store = Loop Stores > Retail Store ID) and adding it to a collection variable (colRSSA).

3. Attempting to bulk insert colRSSA after the loop finishes.

The Issue:

The flow runs successfully end-to-end without throwing an error, but zero records are actually written to the database when checking the developer console. I’ve attached screenshots of my current loop layout and collection variables.

Could anyone share the cleanest way to structure a loop-to-collection and bulk insert for large volumes (2k+ records) in a subflow without hitting silent drop-offs or bypasses? Any advice or layout examples would be massively appreciated!

 

 

#Flow

1 条评论
  1. 今天,00:23

    Hi Mark - 'runs clean but zero rows' almost always means the Create IS failing and the error is being swallowed. Two fast moves to expose it: 

     

    1. Add a Fault Path to your Create Records element (drag from the red node) and route it to a Screen showing {!$Flow.FaultMessage}, or run Flow Debug with 'Show query and DML details' ticked. Debug prints the collection size going INTO the create and how many rows it inserted - that instantly tells you whether the collection is empty or the records are invalid. 

     

    The most common silent-zero with your exact pattern: 

     

    2. The records in colRSSA carry an Id. For an INSERT the record vars must have NO Id - if your Assignment copies a source Retail Store record (which brings its Id along) instead of building a fresh record, the create no-ops. Build a NEW record variable with only the fields you set, no Id. 

     

    Also check: 

    - Create Records set to 'Multiple' from the COLLECTION (colRSSA), not 'One' from the single var. If debug shows colRSSA empty, your add-to-collection Assignment is the culprit - it must use the Add operator with colRSSA as the target. 

    - Run the subflow in System Context (Without Sharing) if the running user may lack Create on Retail Store - DML silently no-ops in user context. 

    - Any required field beyond the lookup fails the row; the fault message names it. 

     

    Clean pattern: Loop > Assignment (set fields on a fresh record var, no Id) > Assignment (Add var to colRSSA) > after the loop, Create Records (Multiple, from colRSSA). 

     

    Hope that unblocks it 🙂

0/9000