The RecordDetail Component

The RecordDetail component provides new ways to display record fields in Flow screens. Flow excels in providing fine control over field combinations, but sometimes you just want to show a bunch of fields from a record in one place without a lot of configuration. This component handles all the formatting, provides 2 column layout, and takes advantage of additional goodies that the platform provides.

If you don’t provide a specific set of fields, this component will show the entire record:

But you can pass in a specific list of field names:

…and you’ll get just the fields you asked for:

If you set the mode attribute to ‘edit’, you can make changes inline and save them immediately with a save button. Note that unlike everything else in Flow, changes you make inside of this component do not get output for use downstream in the flow. In other words, this component will not output a full record. So if you want to use the data that has just been entered and saved, you’ll need to add a separate downstream Get Records element to pull the full record ‘back’ into Flow.

Attributes

recordIdRequired. You must pass a valid recordId into this component.
modecan be “view” or “edit”
fieldsa comma-separated list of field names from the recordId’s object type. If this is not provided, this component will display all fields accessible to the running user’s profile.

Installation

Version 1.1 (Unmanaged)

View Source

View Source

Synergies

You can have RecordDetail automatically display the subset of fields that’s tied to a particular combination of profile and record type by using actions like:

There’s a good video of this here.

Considerations

This component uses the recordEditForm and recordViewForm base components and is constrained by their limitations. It doesn’t support all Salesforce standard objects. For example, the Event and Task objects are not supported. This limitation also applies to any record that references a field that belongs to an unsupported object. The list of supported objects is here.

This component responds to your Display Density settings (“Comfy”, “Compact”, etc…).

For behavior like Required and Validation, think of this component as ‘listening’ to the object and field manager in Setup instead of to Flow Builder. I.e. if the field is configured in Setup required in Setup it will be required in this component. If there’s a validation rule on the field in Setup, it will run on save here.

See more Flow Screen Components

Archived Versions

Version 1

42 replies
  1. Raphael Barreiros
    Raphael Barreiros says:

    THIS
    CHANGES
    EVERYTHING

    Alex, that INCREDIBLE! I really appreciate that! Thanks for you great work!

    Reply
  2. Adam White
    Adam White says:

    Been thinking about this for a long time! If we wanted to configure it to also do record creation, would that be a tough thing to do?

    Reply
    • Alex Edelstein
      Alex Edelstein says:

      It should be a pretty easy improvement to add an attribute called “objectName”. If you pass in no recordId, objectName of Account, and mode of Edit, it should open in edit mode and create a new record on save. I’ll put it on my todo queue, but maybe someone else will get to it first (hint, hint).

      Reply
      • David Rabizadeh
        David Rabizadeh says:

        YES! This would be a a much welcomed enhancement!
        Also, if there is a way for it to honor the page layout of the Record type (if the RT is passed), that would be incredible. Thank you Alex!

        Reply
        • Alex Edelstein
          Alex Edelstein says:

          Unfortunately the underlying components that this relies on don’t expose a way to pass in a record type.

          Reply
  3. Michael Pierce
    Michael Pierce says:

    Alex, once again — LOVE this component. Is there any way to (1) include the “Next” Flow navigation into the Save button (and then hide the Next button) or (2) make the values in the component output values to be saved in the next step in case the user missed it?

    Reply
    • Alex Edelstein
      Alex Edelstein says:

      For behavior like Required and Validation, think of this component as ‘listening’ to the object and field manager in Setup instead of to Flow Builder. I.e. if the field is required in Setup it will be required in this component. If there’s a validation rule on the field in Setup, it will run on save here.

      Reply
  4. rbeachhyp
    rbeachhyp says:

    Agree that this is a game changer!! Is there any way to set certain displayed fields as required? Also, is there documentation on the “Store Output Values” piece of this? (Forgive me if it should be obvious, but I’m new).

    Reply
    • Alex Edelstein
      Alex Edelstein says:

      For behavior like Required and Validation, think of this component as ‘listening’ to the object and field manager in Setup instead of to Flow Builder. I.e. if the field is required in Setup it will be required in this component. If there’s a validation rule on the field in Setup, it will run on save here.

      This component does _not_ output values for use downstream in the Flow. It only outputs a recordId. You would have to follow it with a Get Record to make use of a newly created record.

      Reply
      • rbeachhyp
        rbeachhyp says:

        Yes, I thought it didn’t output any values but then I saw the section “Store Output Values to Section Variables” section when I clicked “Manually assign variables (advanced)” and wondered if I were missing something.

        Good to know about the validation rules. I was hoping I could make some fields required on the component because there are fields that are not required for the object in a different context but I want them to be required for this flow, but I’ll figure something out.

        Thanks for this important tool!

        Reply
  5. catmacey
    catmacey says:

    I don’t seem to be able to install this in production. I get a “Mismatching Versions. This app can’t be installed.
    There are problems that prevent this package from being installed.” Error.

    Production is running Winter ’20 Patch 15.22
    I can install in in my Sandbox which is running Spring ’20 Patch 5

    Should I try installing the older version 1? If so will Flows from sandbox that use 1.1 work when deployed. (I’m guessing not)

    Reply
    • Alex Edelstein
      Alex Edelstein says:

      It sounds like the 1.1 version was built on API version 48, which wasn’t necessary and so was a mistake. If I get a chance, I’ll fix it but it may have to wait until production gets updated in 3 weeks. I think V1 worked fine but didn’t show the ‘mode’ element. You don’t have much to lose by trying it.

      Reply
      • catmacey
        catmacey says:

        v1 installs in Winter ’20 Patch 15.22 and appears to work just fine.
        Thanks for the help and thanks for creating the component.

        Reply
  6. Heath Parks
    Heath Parks says:

    I tried to install this in my sandbox (spring 20) and I got a couple of Apex Compile Failures.

    1. Apex compile failure
    Apex class ContactTrigger: line 3, column 9: Invalid type: ContactBeforeUpdate

    2. Apex compile failure
    Apex class ContactTrigger: line 6, column 9: Invalid type: ContactAfterUpdate

    I am NOT a coder just a point and clicker, so not sure what this means, I know it has something to do with the apex code, but other than not, I got nuttin.

    Any suggestions?

    Reply
    • Justin Baker
      Justin Baker says:

      That looks like an issue with your Sandbox. You have a Trigger named ContactTrigger that’s firing those errors on the install. Is your sandbox configured to install via apex? Not sure why a ContactTrigger would have popped like that otherwise.

      Reply
      • Heath Parks
        Heath Parks says:

        Yep, after I posted this, I looked at my Apex Triggers and saw that we still have/had an old contact trigger bit of code that was deactivated about 3 years ago or so, when I replaced a lot of actions with Process builder. I had not realized that I hadn’t deleted it. I did that and it installed correctly. Thanks for the quick reply! Learning a ton about flow and this site, great stuff!

        Reply
  7. Joshua Petre
    Joshua Petre says:

    Hi Alex, how can I show a field of the the Parent Object:
    For example: Object specified=Opportunity, field to show “Account.Name”.

    Thanks in advice for your answer.

    Reply
    • Alex Edelstein
      Alex Edelstein says:

      That’s not directly supported but you might want to experment with using two RecordDetail components on the same page. The first one would show Opportunity fields and the second would show account fields.

      Reply
  8. Arvind
    Arvind says:

    The automation that this component brings is amazing! Thank you for creating this flow component. Please share if there is a way to introduce spacing between the fields or add section separators? Thanks.

    Reply
    • Marty R
      Marty R says:

      Yes this is very needed so that we can make the screen look as close as possible to the page layout and it is visually friendly to the user.

      Reply
      • Arvind
        Arvind says:

        Alex, I also found when we have screen rendered with the list of fields, currently there is no way for us to pass in a record type that would allow picklist values to be filtered based off that record type. Currently w/o this feature all picklist values are displayed, would that be something doable in this component?

        Reply

Trackbacks & Pingbacks

  1. […] Example: You want your flow to let the user choose a record type from a picklist and then display the layout corresponding to that record type (This is demonstrated in the video above). The Quick Choice package includes several utility actions that make this easy. You first start out with the GetRecordTypeInfobyObject action, which returns separate collections of recordTypeNames and Ids. You then use those as inputs to a QuickChoice control. When the user makes their choice, you use a couple of additional utility actions to extract the Layout fields for the layout that corresponds to the combination of the selected RecordType and the running user’s profile. The layout fields are then passed to the new RecordDetail flow screen component. […]

  2. […] the publication of the RecordDetail flow screen component, it became easy to get flow to show any list of field names you choose to […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply