Record Types

With the ultimate version of the Flow Data Table, you can configure picklist editing with values configured for record types.

In this guide, we will extend the flow from the getting started guide to allow the user to select a record type, filter the retrieved records by that record type, and allow the user to edit a picklist field which is configured with different picklist values for each of the two record types.

If any of the above is confusing, do not worry. We are going to cover the steps in detail below.

This guide assumes you have some basic knowledge of Salesforce record types. If you have never used them before, or are not familiar with them, we suggest reading the following on the topic at Salesforce Help Page

Create Record Types

Create account record types and assign picklist values as described in the Create Record Types Trailhead exercise.

After you complete the Create Record Types trailhead exercise, assign account records to each of the two records types. You can do this by going to an account detail page, click the drop down in the upper right corner, and select Change Record Type. To verify you have records assigned to the record types edit a list view to filter on the two records types:

Modify the Flow

Go to the Accounts flow you created in the getting started guide and perform the following steps.

Create Record Type Flow Variable

This variable will hold the record type id for the selected record type. Follow these steps to create the variable:

  1. On the left side under Toolbox select Manager
  2. Click New Resource
  3. Configure the form as follows:
    Resource Type: Variable
    API Name: RecordTypeId
    Data Type: Text
  1. Click Done

Create a Record Choice Set

A record choice set will retrieve the account record types and allow you to configure them as radio buttons on a flow screen.

  1. On the left side under Toolbox select Manager
  2. Click New Resource
  3. Configure the form as follows:
    Resource Type: Record Choice Set
    API Name: RecordTypeChoices
    Object: Record Type
  4. Under Filter Record Type Records configure as follows:
    Condition Requirements: Conditions are Met
    Field: SobjectType
    Operator: Equals
    Value: Account
  1. Under Configure Each Choice configure as follows:
    Choice Label: Name
    Data Type: Text
    Choice Value: Name
    Field: Id
    Variable: {!RecordTypeId}
  1. Click Done

Create Record Type Screen

This screen will allow the user to select the record type.

  1. On the left side under Toolbox select Elements
  2. Drag a screen element onto the flow
  3. Under Screen Properties set the values as follows:
    Label: Select Account Type
    API Name: SelectAccountType
  1. Drag a Radio Buttons component onto the screen and configure as follows:
    Label: Account Types
    API Name: AccountTypes
    Require: Checked
    Data Type: Text
    Choice: {!RecordTypeChoices}
  1. Click Done
  2. Place the Select Account Type screen between the Start and Get Accounts steps. Your flow should look like the following:

Modify Get Records

Modify the Get Records step so that only records matching the record type are read from the database. Also read in fields that were added to the field set:

  1. Open the Get Records flow element by double clicking on it.
  2. Under Filter Account Records set the form properties as follows:
    Condition Requirements: Conditions are Met
    Field: RecordTypeId
    Operator: Equals
    Value: {!RecordTypeId}
  1. Click Done

Pass Record Type to Data Table

Pass the record type value to the data table so that it presents the appropriate picklist values during editing.

  1. Open the Account Table flow element by double clicking on it.
  2. Click on the Flow Data Table, scroll down, and set properties as follows:
    Table Mode: In Memory Edit
    Record Type Id: RecordTypeId
  3. Scroll down and click the Configure Fields button
  4. Add the fields Type, RecordTypeId
  1. Click Save
  1. Click Done
  2. Save the flow

Run the flow. Select an Account Type and hit next. When you edit an Account Type field in the data table the available picklist fields in the drop down should match the values configured in Setup for that record type.

If the data table does not contain any records then go to some account detail pages and assign record types as described earlier in this exercise.