Last Updated on February 5, 2025 by Rakesh Gupta
Big Idea or Enduring Question:
-
How can I bring data from multiple sources into the data source using the Transform element and then map it to the target data source?
Objectives:
After reading this blog, you’ll be able to:
- Utilize the Transform element to map and transform source data to target data.
- Add multiple data sources to the source data.
- Map fields from multiple data sources to a single target data source.
- And much more!
Pre-requisites:
The first step is to carefully read and follow the instructions outlined in Transform Elements Over Loops: Create Tasks for Opportunities Without Loops blog.Â
Business Use case
Warren Mason, a Junior Developer at Gurukul on Cloud (GoC), got a great idea about the capabilities of Transform Element after reading the articles below. He is confident that he can start using it for his next project.
- Transform Elements Over Loops: A Modern Method for Collecting IDs in Salesforce Flow
- Transform Elements Over Loops: Create Tasks for Opportunities Without Loops
Warren once again reached out to his mentor, Joe Smith, to ask if he could demonstrate how to add multiple resources to source data sources using a real-time use case.
Joe came up with an idea to enhance the automation we built for Transform Elements Over Loops: Create Tasks for Opportunities Without Loops. Currently, the newly created tasks are not associated with a contact. His idea is to associate these tasks with a contact (from the Account Contact Relationship object) whose role is Decision Maker. In his business, each account typically has one decision maker. If there is more than one decision maker, he wants to associate the task with the one who was created first.
Automation Champion Approach (I-do):
Joe plans to add new logic to the existing flow he created as part of the Create Tasks for Opportunities Without Loops. The enhancement involves the following steps:
- Adding a Get Records Element: Add a Get Records element to retrieve the key contact who is marked as the decision-maker.
- Utilizing a Second Data Source: Use the retrieved contact information as a second data resource within the flow.Â
- Mapping Contact ID to WhoId: Map the contact’s ID (retrieved from the Get Records element) to the WhoId field in the target data source.Â
This approach enhances the efficiency and accuracy of the flow, enabling it to better address the business requirement of creating tasks tied to decision-makers for opportunities.
Guided Practice (We-do):
There are 3 steps to solve Warren’s business requirement using Record-triggered After-Save Flow. We must:
- Clone the existing flow.
- Add a Get Records element to find the decision-maker contact.
- Update the Transform element to include a second resource for data source mapping.
Step 1: Define Flow Properties
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the Flow Name that will be modified. In this case, Bulk Create Record Using Transform.
- Click on the Save As New Version button at the top right of the Flow builder.

- Click Save.
Step 2: Adding a Get Record Element to Find the Decision Maker Contact Â
The next step is using the Get Element to find the decision maker contact. For this, we will use the Account Contact Relationship object.
- On Flow Designer, click on the +icon below the Get Open Opportunities element and select the Get Records element.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the Account Contact Relationship object from the dropdown list.
- Select All Conditions Are Met (AND).Â
- Set Filter Conditions
- Row 1:
- Field: AccountId
- Operator: Equals
- Value: {!$Record.Id}
- Click Add Condition
- Row 2:
- Field: Roles
- Operator: Equals
- Value: Decision Maker
- Row 1:
- Sort Account Contact Relationship Records
- Sort Order: Ascending Â
- Sort By: CreatedDate
- How Many Records to Store:
- Select Only the first record
- How to Store Record Data:
- Choose the option to Choose fields and let Salesforce do the rest.Â
- Select Opportunity Fields to Store in Variable
- Id
- ContactId
- Select Opportunity Fields to Store in Variable
- Choose the option to Choose fields and let Salesforce do the rest.Â
- Click the X at the top to save your changes.

Step 3: Update the Transform Element to Include a Second Resource for Source Data
Now we will update the Transform element to add a second resource for the source data. Then, we will map the ContactId to the Task WhoId.
- Double click on Data Transform for Tasks transform element to open it on edit mode.Â
- For the second Source Data select {!Get_KeyContact}.

- Map the ContactId (Second Source Data) to the WhoId (Target Data), as shown below.

- Click the X at the top to save your changes.
In the end, Warren’s Flow will look like the following screenshot:
Once everything looks good, Click Save.
Almost there! Once everything looks good, click the Activate button.
Proof of Concept
To test this flow, I will update the Grand Hotels & Resorts Ltd account, which has four open opportunities, with Tim Barr as the decision-maker.
As per the logic we implemented in the flow, four tasks have been created, associating these tasks with their respective opportunities and decision-maker contacts.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.




I am missing the get accountcontacts node in the final screenshot of the flow. Is there something missing?
You are absolutely right! Thank you for pointing that out. I’ve updated the blog post to include the correct image reflecting the “Get KeyContacts” node in the final screenshot of the flow.