Skip to main content

Transform Data From One Form to Another

Learning Objectives

After completing this unit, you’ll be able to:

  • Convert data table selections to a text collection with the Transform element.
  • Update records that match the contents of a text collection with the In operator.
Note

This badge is one stop along the way to Flow Builder proficiency. From start to finish, the Build Flows with Flow Builder trail guides you through learning all about Flow Builder. Follow this recommended sequence of badges to build strong process automation skills and become a Flow Builder expert.

Transform a Collection into a Different Type of Collection

Let’s build the other version of the previous unit’s flow. In this version, you use the Transform element to create a text collection, rather than a record collection. Instead of storing a series of records, a text collection stores a series of text strings. When you map the source data’s Id field to the text collection, the new collection stores all of the selected records’ IDs as text strings instead of records.

But why is a text collection of record IDs useful? The Update Records element has a specific operator—the In operator—in its filter options. The In operator looks through collections that contain simple values, such as text or numbers, and finds all the records that have a value in the collection. The In operator can’t look through record collections, so you configure the Transform element to turn the record collection into a text collection.

First, return to the All Flows list view and open the Choose Steps to Update flow. This flow should have only two elements: Get Steps, and Select Steps to Update.

The Choose Steps to Update flow has only two elements: Get Steps and Select Steps to Update.

Map the ID from Source to Target

Next, use a Transform element to create a text collection of the records’ IDs.

  1. After the Select Steps to Update element, add a Transform element.
  2. For Label, enter Transform Step IDs.
    The API Name should auto-populate as Transform_Step_IDs.
  3. In the Source Data box, click Add flow resource for source data.
    • For Resource, select the Select_Steps screen component.
    • In the Select_Steps box, click the > in the selectedRows line to display the collection’s available fields.
  4. In the Target Data box, click Add flow resource for target data.
    • For Data Type, select Text.
    • Select Allow multiple values (collection).
    • Click Create.
  5. In the Source Data column, mouse over the Id field and click Socket in the Id line.
  6. In the Target Data column, click Map in the Id line.
  7. Save the flow.

Update the Onboarding Project Step Records from Their IDs

Last, you add an Update Records element with a filter that finds all the Onboarding Project Step records whose Id is in the transform’s text collection. Then configure the Update Records element to update the Onboarding Project Steps’ statuses to the value that the user selected on the screen.

  1. After the Transform Step IDs element, add an Update Records element.
  2. For Label, enter Update Steps.
    The API Name should auto-populate as Update_Steps.
  3. For How to Find Records to Update and Set Their Values, select Specify conditions to identify records, and set fields individually.
  4. For Object, select Onboarding Project Step.
  5. In the Filter Onboarding Project Step Records section:
    • Make sure Condition Requirements to Update Records is set to All Conditions Are Met (AND).
    • For Field, select Record ID.
    • For Operator, select In.
    • For Value, select Transform Step IDs.
  6. In the Set Field Values for the Onboarding Project Step Records section:
    • For Field, select Status.
    • For Value, select the Select Steps to Update screen, then New Status.
  7. Save the flow.
    The Choose Steps to Update flow with the Get Steps, Select Steps to Update, Transform Step IDs, and Update Steps elements.

All done! Notice how the flow canvas looks identical to the previous version, even though the elements’ configurations are quite different. Both versions took about the same amount of time to configure, and take about the same amount of time to run. It’s important to remember when building a flow: There can be a lot of ways to make the same automation happen, and sometimes choosing your flow’s method comes down to personal preference.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback