Transform Element in Salesforce Flow : Bijay Kumar

Transform Element in Salesforce Flow
by: Bijay Kumar
blow post content copied from  SalesForce FAQs
click here to view original post



### Summary of the Transform Element in Salesforce Flow In Salesforce, the Transform element is a powerful tool used to copy and map data between different objects, such as transferring information from a Job Application to a Candidate Profile when a recruiter marks an application as "Shortlisted." This process simplifies data handling by allowing users to avoid complex loops and multiple assignments that were previously necessary. #### Key Details: - **Transform Element**: A feature in Salesforce Flow that helps map and convert data formats, making it easier to work with complex data structures. - **Use Cases**: - Sending data from a Flow to an Integration Procedure (IP). - Mapping input and output for custom Apex classes. - Transferring data between custom objects in Salesforce. - **Example Scenario**: When an HR team shortlists a job application, the Transform element automatically creates a corresponding record in the Candidate Profile object. - **Steps to Implement**: 1. Create a Record Trigger Flow that activates when the "Shortlisted" checkbox is checked. 2. Use the Transform element to map fields from the Job Application to the Candidate Profile. 3. Create a record for the Candidate Profile using the mapped data. #### Additional Context: The Transform element was introduced in the Winter ’24 release, streamlining the process of data transformation in Salesforce Flow. It replaces the older method that required looping through records and assigning values manually. #### Example of External Data Sync: The Transform element can also be used to send Salesforce data to external systems, like an ERP. For instance, it can convert Salesforce order data into a JSON format required by the ERP, ensuring seamless data integration. ### Conclusion The Transform element in Salesforce Flow is essential for efficiently managing data transfers between objects and external systems, enhancing automation and reducing manual effort. ### Relevant Hashtags for SEO: #Salesforce #SalesforceFlow #TransformElement #DataMapping #Automation #CRM #Integration #SalesforceTutorial #DataTransfer #ERPIntegration #CustomObjects #SalesforceBestPractices


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.

Use Transform Element to Transfer Data to a Different Object in Salesforce Flow

First, let’s understand the scenario for which we are using the transform element in Salesforce Flow. Then, we will create the flow that utilizes this element.

1. Use Case:

We have two custom objects: Job Application__c and Candidate Profile__c. Below, you can see the fields we have in the job application object.

When the applicants submit the applications, they will be stored in the job application object. The HR team will review the applications and shortlist the applicants for interview, which will be stored in the candidate profile object.

To shortlist a candidate, the HR team needs to check the ‘Shortlisted’ checkbox.

Create Custom Object in Salesforce

Now, whenever the HR team shortlists the applicant, it should automatically get added to the candidate profile object.

Salesforce Custom Objects

2. Add Transform Element in Record Trigger Flow in Salesforce

Go to Setup -> in Quick Find search for ‘Flows‘ and click on it -> New Flow -> Start From Scratch -> Record Trigger Flow.

Here, we selected the record trigger flow because when the HR team checks the shortlisted checkbox, the applicant should only be added to the candidate profile object.

In the start element, select the job application object because from this object, the checkbox (shortlisted) is our triggering condition.

Then, select when the flow should trigger. Here, we need to select ‘on record create’ or ‘on record update’, because the HR team can also shortlist the application while creating a record, or after creating (updating) a record.

Add Transform Element in Salesforce Flow

After that, add the condition as per your business logic. Here, I have added that when the Shortlisted checkbox is checked, the record needs to be added to the candidate profile object.

In the optimized flow, we need to select the Actions and Related Records because we need to create a record for another object.

Create record Trigger Flow in Salesforce

Next, we need to add the Get Record element to create a record collection of job applications.

In the Object field, select the Job Application __c object that we created and the condition, if required. This condition filter records to optimize the flow.

Add Get Record Element in Salesforce Flow

To create the collection of records, we need to select ‘All records‘ in the ‘How Many Records to Store‘ option and then select the ‘Automatically store all fields‘ option.

Create Record Collection using Get Record Element in Salesforce Flow

Now, add Transform Element, where we transfer the record from the job application to the candidate profile object.

The Transform element in Salesforce Flow was initially released in the Winter ’24 release. Earlier, we used the Loop and Assignment Element to perform the same task, but now only the Transform Element can accomplish this task.

The loop element we were using to iterate over all the records available in the collection (get records). Then, the assignment element we were using was to assign the field value of one object to another.

However, we now need to add a transform element. Provide the Label, and the API Name will be automatically populated.

Next, we have two options: Source Data and Target Data.

  • Source Data(Where the data comes from):
    • We can use source data to select the values that we want to transform or map to another object.
    • This data or records we already have in the flow. Here we have a job application (record collection).
  • Target Data(Where the data will go):
    • We use target data to determine where the data or record will be directed.
    • This data we want to create or send after the transformation. Here is the candidate profile (object) records we want to create.

To select the source data, click the + icon and select the record, collection, variable, or Apex-defined data that matches your data source.

Here, we have created a collection in the Get Record (Get Applications) section. You can see that after selecting the source data-related fields, they are also visible to map with the target data.

Next, click the + icon in the Target Data. There, we need to configure the resource.

Here, we want to create a record for a specific object. For that, in the Data Type select Record. Check the Allow multiple values and choose the Object to which you want to create the record.

Transform Element in Salesforce Flow

After selecting the target data, you will see the fields related to the selected object. Here we have candidate profile object fields.

Next, we need to map the fields from the source data to the target data. For that, you need to select a field from the source data, and in the target data, with which field you want to map, click on that field.

In this way, we need to map fields so that when the record gets transferred from source to target, the value gets assigned to the mapped fields.

Map fields using Transform Element in Salesforce Flow

After mapping the fields, we need to create the record for those that get transferred from the source to the target data.

To do this, add the Create Record element, providing a Label and API Name. After that, in ‘How to set record field values‘, we need to select ‘From a Record Variable‘. Because in the target data, we configured the resource to allow multiple values.

Then, in the Record Collection option, we need to select the transfer element (the label we provided to the transfer element).

Transfer records Using Transform Element in Salesforce Flow

Now we are ready to save the flow. For that, click the Save button, provide the flow Label, and the API Name will be automatically populated.

After that, always debug the flow before activating it to test that the working flow is correct and no runtime errors. Then activate the flow.

Use Transform Element in Record Trigger Flow

Now, navigate to the app where you added the custom objects and open the job application object. Then, open any application to shortlist.

I am updating Alex Anderson’s application, marking it as Shortlisted, and saving the record. Now the flow should create the record for this shortlisted applicant in the candidate profile object with the same field values.

Use Transform Element in Salesforce Flow

As you open the candidate profile object, you will see the record has been created with the values from the job application record.

Salesforce Flow Transform Element

In this way, we can utilize the Transform element to transfer data from one object to another and map fields in Salesforce Flow.

Use Transform Element in Salesforce Flow to Syncing Product Orders from Salesforce to an External ERP System

Here, the transform element in the flow helps convert Salesforce data, such as Order or OrderItems, into the JSON format.

For example, in Salesforce, if we have an orderID and name, then the transform element converts the API name into the format required by the external system, such as “order_id” and “customer_name“, respectively.

It simplifies complex field mapping, renaming, setting defaults, and data cleanup without manual effort.

Use Case:

A manufacturing company uses Salesforce for sales and an external ERP system for managing orders, inventory, and billing.

Whenever a sales order is confirmed in Salesforce, the company needs to:

  • Send the order data (products, quantities, pricing, customer info) to the ERP system.
  • The ERP expects data in a specific nested JSON structure.

1. Create Named Credentials in Salesforce

Navigate to Named Credential from the Quick Find search.

First, we need to create a new external credential to connect with external systems (like APIs) securely. Here, we can select whether we need to authenticate the API or connect to it without authentication.

It stores the login or authentication details (like API keys or tokens) safely, so you don’t have to hard-code them in your flow or Apex code.

This ensures secure and easy communication between Salesforce and other systems.

Create External Credential in Salesforce

After that, we need to create a Named Credential in Salesforce to store the endpoint URL and link it with authentication (External Credential) in a secure and reusable way.

I have created an account with the Webhook.site an external ERP platform used to manage orders, inventory, and billing.

Here, you need to copy the URL to add in the named credential.

Endpoint URL of External API

Paste the copied URL, select the external credential you created, and click the Save button.

Create New Named Credential in Salesforce

2. Assign Permission Set for the User

Initially, the user doesn’t have external credential principal access, so we need to create the permission set and assign it to the user.

Assign External Credential Permission to User

3. Create an OpenAPI YAML File for Testing

  • Open your browser and go to https://github.com.
  • Click your profile → go to repositories. -> Inside the repo, click “Add file” → “Create new file
  • Provide the file name. For example:order-api.yaml

Paste the OpenAPI YAML content in the file that you created.

openapi: 3.0.0
info:
  title: Order API
  version: 1.0.0
paths:
  /:
    post:
      summary: Create order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '200':
          description: Order created
components:
  schemas:
    OrderRequest:
      type: object
      properties:
        order_number:
          type: string
        customer:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
        items:
          type: array
          items:
            type: object
            properties:
              product:
                type: string
              qty:
                type: integer
              unit_price:
                type: number

Save the file, and copy the Raw URL from GitHub. Below, I have given an example of how the URL would be.

https://raw.githubusercontent.com/your-username/openapi-demo/main/order-api.yaml

4. Remote Site Setting in Salesforce

Whenever we use an external URL, such as a raw GitHub link, in Salesforce, we must manually allow it using Remote Site Settings.

Please fill in the details as shown in the image below.

Set Remote Site Setting in Salesforce

5. Register the External Service in Salesforce

Now we need to register an external service in Salesforce, which enables us to connect to and utilize external web services within our Salesforce environment without requiring coding.

Provide the External Service Name according to your requirements, and select the Named Credential that we have created.

Since we are using the raw GitHub URL, in the Service Schema, we need to select the Absolute URL option. Then paste the copied raw URL in the URL field and click the Save & Next button to proceed.

Add an External Service in Salesforce

After that, select the POST operation checkbox and click the Next button to proceed.

External Services in Salesforce

After that, you can see that the Input Parameter Apex Class has been created. Then click the Finish button to save the external service.

External Service Actions in Salesforce

6. Create a Salesforce Flow and Use the Transform Element (Screen Flow)

Now, we will create the Screen flow where we will take the Sales Order and send the order data (products, quantities, pricing, and customer information) to the ERP system.

Here, the transform element in the flow helps convert Salesforce data, such as Order or OrderItems, into the JSON format.

To create the flow, navigate to Setup -> in Quick Find search for Flow -> New Flow -> Start From Scratch -> Screen Flow -> Next.

Add a Screen element to take the order details and drag some Text and Number components onto the screen. Provide the label according to your requirement.

Add Screen Element in Salesforce Flow

Then we need to create the variables as many as the screen components we have added in the screen element.

To create the variable, click “New Resource.” In the Resource Type, select Variable, and provide the API Name according to the fields we have in the screen element.

Choose the Data Type accordingly, such as Text and Number for fields, and select ‘Availability Outside the Flow’ for both input and output.

After that, we need to add the Assignment element to assign the fields of the screen components to the variable we created.

Add Assignment Element in Salesforce Flow

Now add the Transform element. Provide the Label, and the API Name will be automatically populated.

Next, we have two options: Source Data and Target Data.

  • Source Data(Where the data comes from):
    • Here we are getting data from the screen element, and we have assigned that data to variables using the Assignment element.
  • Target Data(Where the data will go):
    • We want to pass the data to the External ERP system. For that, we have added the URL in the external service.
    • Next, click the + icon in the Target Data. There, we need to configure the resource.
    • Here, we need to select the Data Type as Apex-Defined, and in the Apex class, we need to choose the ExternalService_OrderService_OrderRequest class.
Create Target Data in Transform element Salesforce Flow

To select the Source Data, click the + icon and choose the variables that we created. Now, map the fields from Source to Target data.

Add Transform Element to Salesforce Flow

Next, we need to add the Action element to send the mapped data to the external system. In the action element, search for the External Services that we added in the above step.

Add Action Element to Salesforce Flow

Next, select the ‘Post external service’ option, as we will be sending data to an external system.

External Services Action in Salesforce

Provide a Label, and the API Name will be automatically populated. Next, in the “Set Input Values for the Selected Action,” we need to set the Body. Here, we need to select the source from which we are providing input to the external service.

We are providing input from the Transform element, so here I have selected that one.

Post External Service in Salesforce

After that, save the flow and provide a Label as per your requirement. Next, we need to debug the flow to test it before activating it. For that, click the Debug button.

Transform Element in Salesforce Flow

Now we need to provide the order details to the screen component that we added, and click the Next button.

Debug Salesforce Screen Flow

As you click the Next button, you will see a message indicating that the order has been successfully submitted. Additionally, the code we added to the GitHub repository displayed a success message.

Run Salesforce Flow

Also in the debug log, you can see the Transform element with Source data and the Target data. We mapped the value successfully.

Test Transform Element in Salesforce

Now, let’s verify whether the order details we provided in the screen flow are transferred to the external system. For that, you need to navigate to the Webhook website, which is the endpoint URL of our API.

There you can see the order details, which means the transform element successfully mapped data from Salesforce to the External system.

And the Action element sends the data from Salesforce to the External system.

Transfer Data From Salesforce to External API

In this way, we can utilize the Transform element in Salesforce Flow to synchronize product orders from Salesforce to an external ERP system.

Conclusion

I hope you have an idea about the transform element in Salesforce Flow. In that I have explained when and how we need to use the transform element in Salesforce flow.

With that, we have seen various examples of transferring records from one object to another using the Transform element and syncing product orders from Salesforce to an external ERP system using the Transform element in Salesforce Flow.

You may like to read:

The post Transform Element in Salesforce Flow appeared first on SalesForce FAQs.


June 11, 2025 at 07:14PM
Click here for more details...

=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce