Learn how to use the Salesforce Flow Transform element to map Opportunity data to Task records and bulk-create tasks without using Loop elements.
Overview
The Transform element in Salesforce Flow is a powerful alternative to loops when you need to map and transform fields from one object to another and then perform a single bulk DML operation. In this walkthrough you’ll see how to create tasks for all open Opportunities related to an Account using an after-save Record-Triggered Flow that leverages Get Records, Transform, and Create Records elements.
Business use case
When an Account is updated, find all related open Opportunities and create a Task for each Opportunity with these fields:
- Subject: Opportunity Name
- Status: Not Started
- Priority: High
- Due Date: Today + 15 days
- Assigned To: Opportunity Owner
- Related To: Opportunity record (WhatId)
Step-by-step
Follow these four main steps to build the flow:
- Define Flow Properties
- Setup → Flows → New Flow → Start from Scratch → Record-Triggered Flow
- Object: Account, Trigger: A record is created or updated, Optimize for: Action and Related Records; Save and close the start screen.
- Get open Opportunities
- Add a Get Records element: Object = Opportunity
- Filters: AccountId Equals {!$Record.Id} AND IsClosed Equals {!$GlobalConstant.False}
- How Many Records to Store: All records; Choose fields and let Salesforce do the rest — store Id, Name, StageName, AccountId, OwnerId.
- Transform — map Opportunity data to Task records
- Add a Transform element; Source Data = {!Get_Open_Opportunities}
- Target Data: Record, Allow multiple values (collection) = checked, Object = Task
- Map fields:
- Subject ← Name
- OwnerId ← OwnerId
- WhatId ← Id
- Status = fixed value “Not Started”
- Priority = fixed value “High”
- ActivityDate = formula (Today + 15 days)
- Create Records
- Add a Create Records element configured to create multiple records using the record collection produced by the Transform element (e.g., {!Data_Transform_for_Tasks}).
Tips and nuances
- Using Transform removes the need for a Loop: transform performs mapping across the entire collection and returns a collection of target records ready for bulk create.
- Create Records performs a single bulk DML operation, which is more efficient and avoids per-iteration DML limits.
- If the formula option inside Transform is not visible in your org, check your Flow runtime version and Salesforce release notes — UI behavior can vary across releases.
Proof of concept
During testing with On-Screen Debug, the Transform element returned four Task records when the Account had four open Opportunities. A single Create Records element then inserted all four Tasks in one DML call.
Conclusion — Why this matters
Using the Transform element streamlines data mapping and bulk record creation inside Salesforce Flow. For admins and developers it reduces complexity, improves performance by consolidating DML operations, and makes flows easier to maintain. Apply this approach when you need to convert one collection of SObjects into another (for example, Opportunities → Tasks, Contacts → Cases, or custom mappings) and prefer a single bulk insert over iterative operations.
Categories: Salesforce Flow




Leave a Reply