Transform Element in Salesforce Flow

In Salesforce, you may need to copy data from one object to another. For example, your company uses Salesforce to manage job applications. You have two custom objects: Job Application and Candidate Profile.

When a recruiter marks a job application as “Shortlisted”, you want to automatically create a candidate profile record using relevant fields from the application.

Instead of using a loop and multiple assignment elements to transfer each field from the job application to the candidate profile, we can use the transform element.

In this tutorial, we will learn about the transform element in Salesforce Flow. As you know from the word ‘transform’, we are essentially changing one state of data into another.

We will now explore how to use the transfer element to transfer data from one object to another.

What is the Transform Element in Salesforce Flow?

The Transform element in Salesforce Flow helps us to map and transform data from one format to another, which is especially useful when working with complex data structures, such as integration procedures, custom Apex classes, or external services (like APIs).

It’s like a bridge that connects two different types of data and helps us rearrange or modify the data before sending it to the next step.

When Should We Use the Transform Element in Salesforce Flow?

Below, I have provided the use cases where we can utilize the Transform element in Salesforce Flow.

  1. When we want to send data from a Flow to an Integration Procedure (IP): We can use the Transform element when we have data in the flow, such as account or contact information, and we want to send it to another system or service using an Integration Procedure.
    • For example, we want to send a contact’s name and phone number to an external system. The external system expects ‘fullName‘ and ‘mobile‘ instead of ‘name‘ and ‘phone‘. Then we can use the transform element to rename the fields before sending.
  1. To map the input and output of an Apex-defined data type: When working with custom Apex classes in a Flow, we need to pass values in or out. The transform element helps us easily connect flow variables to Apex class fields.
    • For example, we have a class with fields like productId, quantity, and price. We can use the transform element to fill these fields using Flow data.
  1. We can use the transform element to transfer data from one object to another and map fields in Salesforce Flow.