Get a Layout’s Field Names – ‘Get Layout Fields’ Action

With the publication of the RecordDetail flow screen component, it became easy to get flow to show any list of field names you choose to give it. In many use cases, you might want to leverage your existing Layouts, particularly in situations where you’ve customized layouts on a per-record-type basis. Other recent tools make it easy to let users select record types and obtain layout id’s. This action takes a Layout Name and Object Name and returns a CSV string of the layout’s field names. To see this action in action, check out this video.

Inputs

AttributeTypeDescription
Layout NameStringexample “Account (Marketing) Layout”
Object NameStringexample “Account”

Outputs

AttributeTypeDescription
layoutFieldsCSVStringComma-separated list of layout fields

Installation

Version 1.2.4 Unmanaged

Old Versions

Version 1.2.3 Unmanaged

Source

source.

Subscribe
Notify of
guest
8 Comments
Inline Feedbacks
View all comments
Elliot Hebert

I am getting a “List index out of bounds” error when running this (In debug). I am properly pulling the layout id in an action before this, and for the objectName input I have tried bout Object Name / Object API Name.

Does this just not work in debug or am i missing something?

Thanks!

Alex Edelstein

If it works in non-debug but not in debug that would be very unusual. is that the case?

if you’re comfortable, send me some credentials (aedelstein@salesforce.com) and I’ll take a look.

Alex Edelstein

try the new version 1.24 above

[…] Ragan Walker and I over at CapTech Consulting have been hard at work at an insanely useful Generate CSV invoked action for you all. I consider this the inverse of Narender Singh’s ‘Create Records from CSV‘ action. We built this to fully utilize some of UnofficialSF’s awesome custom actions like ExcecuteSOQL, Send Rich Text Email, and Get Field Names from a Layout. […]

Raz Gat

Hey Alex, I am getting a “Mismatching Versions” error when trying to install. Why is this? Thanks

Foster

I’ve installed v1.2.4 and I’m getting the following error:

Error Occurred: An Apex error occurred: System.NullPointerException: Attempt to de-reference a null object

  1. Using this with a custom object that is deployed and the page layout is assigned to my profile.
  2. Both apex classes are assigned to my profile

Please advise.

Foster

I solved this. Setting the excluded fields toggle to True and leaving it blank resolved the issue.

[…] record forms are displayed based on Record Type, take a look at the posts about Record Detail, Get Layout Fields and Get Layout By Record Type and Profile, and Get Record Type by […]