Salesforce Dynamic Forms: Overview & Deep Dive Tutorial
By Christine Marshall
October 19, 2022
The #1 asked for feature is here. It’s been 13 years in the making, 10,771 votes, and 30 merged ideas; finally, Salesforce Dynamic Forms are available in an org near you.
In this post we’ll cover what Salesforce Dynamic Forms actually are, and how to get started, as well as what is and is not supported.
*Please note that since this video was recorded, Dynamic Forms has seen huge changes and the majority of standard objects are now supported!
What are Salesforce Dynamic Forms?
The premise of Dynamic Forms is to create user centric, intuitive page layouts that display the right information at the right time. Over time, the page layout, or “Details” section in Lightning pages, can become congested with fields. These fields may well be necessary but not all the time or to all users. The closest resolution we’ve had is to create multiple page layouts and different profiles, which is labor and config intensive.
Well, no more. With Dynamic Forms you’ll be able to:
Place fields anywhere on the layout without needing to add them to the traditional page layout (“Details” component).
Use visibility rules to make fields and components appear and disappear based on criteria you choose.
Do away with multiple page layouts.
Improve page load times.
Are Dynamic Forms Available for Standard Objects?
As promised at Dreamforce ‘22, Salesforce has extended Dynamic Forms to support hundreds of standard objects! Specifically, support has been extended to the majority of LWC-enabled standard objects (Lighting Web Component enabled).
Dynamic Forms are not available on objects that do not support Lighting Web Components, including Campaigns, Tasks, and Products. To ascertain if an object supports Dynamic Forms, edit the record page on the Lightning App Builder – if you see the “Fields” tab in the component panel, Dynamic Forms are available.
When Can I Get Salesforce Dynamic Forms?
Dynamic Forms are available now! Simply go to the Lightning record page of an object and select the “Highlights Panel” or the “Record Detail” component, then you’ll see the option to “Upgrade Now” and can choose between migrating an existing page or starting from scratch.
How Do I Set Up Salesforce Dynamic Forms?
1. Create or Migrate a Page
Open the Lightning page you wish to upgrade, select the “Record Detail” or “Highlights Panel” component, and choose “Upgrade Now”.
You can also create a brand-new page by going to your object, selecting “Lightning Record Pages”, then choosing “New”.
Once you’ve migrated or created a new Lightning record page, you will see the option to add a “Field Section” component which will then enable you to add fields directly to the Lightning record page.
In this example, I have removed the traditional “Details” tab and created a custom tab called “Candidate Information”. I then dragged a “Field Section” component onto my tab.
Note: You need to add a Fields Component before you are able to add fields!
2. Add Fields to a Component
Once you’ve added a “Field Section” component to your page, you can start to add individual fields. A “Field Section” can be added in many places, not just in tabs, so go wild!
First, let’s add some fields that should always be visible to anyone who views the record:
Don’t forget to name each field section!
With a field selected, you can choose the UI behavior such as “Read Only” or “Required”.
3. Make Fields and Components Conditionally Visible
We can make both fields and entire field components conditionally visible.
Below, I’ve added a new “Fields Section” component titled “Confidential Information”, and made it visible only to users with the Profile name “HR”:
I’ve also made the field “Distance Willing to Travel” conditionally appear only if “Willing to Travel” equals TRUE:
This is a real game changer. In edit mode, our conditional field will appear once “Willing to Travel” is checked, without the user having to save or refresh the page.
Something worth noting is that Field visibility and Field Section visibility behave differently. Although both are dynamic e.g. can be set to appear or disappear based on filters you define, Fields are super dynamic as they are evaluated live (as a user makes changes). This means that a field may appear/disappear while a user is editing a record. In contrast, Field Sections are only evaluated on Save, so a new section won’t appear/disappear until the user saves the record.
4. Plan Page Performance
Tabs and accordion load only when selected, so instead of adding lots and lots of “Field Section” components to the initial page (e.g. what shows when you select a record), consider utilizing tabs or the accordion for improved load speed and performance.
This is also a good time to check out any Tips or use the Analyze Button to evaluate your page performance.
From the Salesforce Mobile App Setup, enable “Dynamic Forms on Mobile”.
If your page contains a Record Deatil – Mobile component, your users will see the layout defined on the page layout, and not the layout defined by Dynamic Forms. If you want your users to view Dyanamic Forms on their mobile device, be sure to not only enable “Dynamic Forms on Mobile”, but also remove the Record Deatil – Mobile component from the page.
again confusing terms....FORMS! A form is not what is being described it should be called DYNAMIC LAYOUTS...Salesforce has to strive for PRECISE nomenclature!!
Noticed a different behaviour after enabling Dynamic forms. I was using "Compact" density setting before dynamic setting enabled. Once enabled and activated, Compact density setting is not working. Looks like that dynamic form is going to have only "Comfy" layout working for now...??
Thank you so much for this article! I couldn't figure out how to do this on my own - and turns out I am not able to do this yet on standard objects. Good to know before I wasted more time!
Hi Jai, I'm hearing this from other users as well. Check out this thread for updates: https://trailblazers.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A000000TyRhSAK&fId=0D54S000004O0SYSA0
If you enabled in an environment but not in the target org, you'll receive the following error during deployment, "Your org doesn't have access to component flexipage:column"
I'm struggling with filtering on fields on the parent page using fields on the child object. I have one to many, so I can't add a lookup field to the child on the parent page. That seems to be a requirement to use the component filter unless I'm missing another step?
I have created a field section and added few fields there and I wanted them to be Read only. So selected Read only in the UI behavior. But it is not reflecting. The tool tip for UI Behavior states that "If these settings are not editable, then the assigned behavior comes from the Object Manager Field definition". I have not understood this properly.
Added a Field Section on a Tab above a standard Record Detail component. The New record and Edit button functionality don't work as expected rather you can only create/edit the fields in the Field Section while the Record Detail fields are not presented. Bug or intended behavior?
So we have dynamic forms enabled, but for some objects it seems editing the fields is not available, but on others it *is* available. Not sure why or how to fix this. Any thoughts? I'm not marking any of the fields as read-only. The fields are not read-only on the default page layout either.
The only difference I'm seeing at the moment is that I've overridden the edit function in classic to be a visualforce page. In lightning, I have that VF page embedded into the "Details" tab of the lightning page layout.
I've been playing around with Dynamic Forms and I want to confirm with everyone else on my findings:
1) When making certain field(s) visible based on a condition set to the controlling field, this takes place after the new record is saved. Let's say I want to make 3 other fields visible when I make Mission Code = 99A. If I'm creating a new record and set Mission Code = 99A, the 3 other fields are not made visible in the new record page. After I save the record, the 3 other fields appear.
2) This is highly useful for full-license users meaning I can't take advantage of Dynamic Forms on community pages, is that correct?
Has anyone noticed that fields that are dynamically displayed keep the value of the field, even if it switches to hidden? So if you have field 1 as a Yes/No picklist, and then field 2 only displays if field 1 is yes...if you select Yes for field 1, then specify something in field 2, THEN go back and put No for field 1, field 2 disappears from the screen, but the value remains.
Ideally, it would work like dependent picklists. Ive even tried it WITH dependent picklists. Making field 2 have no values associated with Field 1 = No. In the standard details page, if you select "No" for field 1, the values in field 2 get wiped out. This does not happen with the field section component. I feel like this needs to be resolved before this feature to give its full value.
Hi Jaclyn - that was not my experience. When creating a new record in your example, if you make Mission Code = 99A, the other 3 fields should display if it is setup properly. I'm not sure about the community pages - haven't' tried that yet.
Hi Chris, The Dynamic Forms will only adjust the visibility of fields on the layout, it will not adjust the content. If you need to also adjust the content you could create a flow that would adjust the content based on the same criteria that adjusts the visibility on the layout.
For me, field conditional visibility works without issue. When I try to apply a filter to a field section, all the fields in that section only appear AFTER the record is saved.
For me, the individual field conditionally visibility works without issue. However, when I apply a filter to a Field Section, that field section only appears AFTER the record is saved.
Thank you for this! When I go to User Interface > Record Page Settings, Dynamic Forms aren't listed as an option to toggle on. We're using Lightning and are on Enterprise Edition... I wonder where I might be going wrong?
Hi Julia,
The official Salesforce instructions are:
How: To enable Dynamic Forms in your org, from Setup, enter Record in the Quick Find box, and then click Record Page Settings. In the Dynamic Forms section, flip the switch to On.
If you are unable to see this I recommend you post in the official chatter group: https://trailblazers.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A000000TyRh&s1oid=00D300000000iTz&s1nid=0DB30000000072L&emkind=chatterGroupMembership&s1uid=0053000000CU5hm&emtm=1587493482205&fromEmail=1&s1ext=0
Hi Julia,
A quick update for you. It seems Dynamic Forms no longer needs to be enabled. You can simply head to your custom Lightning record page and choose to upgrade!
Best, Christine
Hello Christine,
So if we use the Dynamic Forms, we can never use the page layout for new records? :(
I mean, I love the Dynamics Forms, since you can distribute the details fields in different Tabs. But I want to use the Page Layout as the new record page.
Thanks
Hi,
If you use conditional field sections/fields then these do not work with the "Details" component. In addition, when Dynamic Forms are used, the field sections appear when you create a New record, not the "Details" section.
Best, Christine
Any of you able to deploy field sections and individual fields (with visibility conditions) from one org (sandbox) to a target org? For some reason, when I deploy the flexipage component, the field sections goes through, but individual fields added to the field sections are not going with. Is there a specific component type that I need to include on my deployment besides the flexiPage? I would appreciate if someone has been able to do that successfully. Thanks!
Hi Christine,
Thank you, My query is we can edit the page layout with dynamic forms after the record is created, for example lets assume Case object, i can dynamically change the section once Case record has been created, can this be done while creation of the record itself lets say based on a picklist value the form displays different sections.
Hi Suresh,
Changes made to the page layout using Dynamic Forms are applied to existing records and to the Create New screen. So, when creating a new record, you can choose to have fields dynamically appear based on the values of a picklist. In my org, additional fields appear if the Rating = Hot.
Hi,
We have created Dynamic Page forms for agreement object. Dynamic forms are working fine during creating & edit new agreement. But if we click the Apttus CLM Amend button, then edit page is coming in the form of standard page layout instead of dynamic Page form. Can you help me in this?
It is but it's probably not that obvious because it doesn't work like selecting values in a report or list view. Instead of selecting multiple values, you'll need to create multiple filters. In each filter, select the same field but choose a new picklist value. Then make sure the filter logic makes sense e.g. all filters are true or add filter logic.
Hello Christine,
Is it possible to select parents fields from field section on child record page. Let say I am on contact record, can I have fields of related account record.
Hi Rahul/Jeremey,
I know it is too late to answer. You can use "FlexiPage" component to deploy the changes. If you face challenges like fields not added in layouts but just the sections are visible on dynamic forms, try changing the API version of Package to 49.0 and above, retrieve and then deploy.
Thanks
Gireesh
Hi Jeremy,
Sorry it's to late to reply,
You can retrive it using the FlexiPage tag.
For Example:
Account_record_page
FlexiPage
And deploy using the same.
Thanks,
Rahul
Hi Jaclyn, In my experience whether you are creating a new record or updating an existing record, the conditional visibility of fields works if you have all 4 fields in your case within the same field section. If you fields spread out in multiple field sections, then it only works after you save the record.
In my experience, when you trying to create new record or update an existing record, as long as you have the controlling and the dependent fields all within the same field section then the visibility works fine. If you have fields spread in different field sections, it works only on saving the record.
Works great for editing records - not so great for creating new records as of yet, since the field sections don't evaluate until "Save." Workaround is to have a fairly simplistic page visibility that forces users to create an initial record that will trigger what becomes visible. When they save, Salesforce will open the newly created record with the fields needed - they will then need to edit to fill in additional fields. This does make it a 2 step process - still potentially helpful, but requires sufficient user training/awareness. Else, continue to use page layouts or quick actions for record creation with specific fields.
Could be a couple of potential issues. Page might need refreshing, you could exit the page and then re-open to see if that helps, or try an incognito browser. Otherwise it's likely a case for Salesforce Support!
If you see the visibility change only after the record is saved, make sure your controlling field isn't a formula. Those are only evaluated after the record is saved so changes to them won't affect the layout until then.
hi there, is there any way to land on the detail tab instead of the form tab i created? watch this video. this can't be how it's supposed to work, right?
https://www.screencast.com/t/8bYRwTea
Hi Lee,
Dynamic Forms replaces the "Details" component. Once Dynamic Forms is being used, the New and Edit options will use that layout instead.
I'm not sure why you would want both the Details component and Dynamic Forms?
Hello, Thank you very much for this beautiful presentation and this very interesting article.
I have done the setting when I do a record update the contions work.
But when I create a record the conditions don't work.
In my case I have 2 type records.
thanks a lot for your help
Hi, when using the accordion option on Dynamic Forms is it possible to keep multiple sections open at once? E.g. currently when I open the second accordion section the first one is closed but I may need to refer to that for some data and it's a pain having to open only one at a time. Thanks
Great post Christine!
I really appreciate the in-depth look at form building in Salesforce. Form building can be a crucial aspect of any organization's workflow, and it's important to have a tool that is both user-friendly and powerful. The tips and resources you shared will be incredibly valuable for anyone looking to improve their form building skills on the platform.
Thanks for sharing your expertise!
Hi Christine, the changes I make for one page layout in Edit Page is applied to all different page layouts and it makes it impossible to customize different page layouts separately. Do you know if there is a way around this? Thank you!
On Dynamic Forms, I have added field section and fields. Few of my fields are picklist and they have default values setup on field level.
When I see those fields on Dynamic form , the default values are not coming on the picklist.
Any idea how to show the default values of picklist on dynamic forms.
Hi, We're just getting around to rolling this out across our org and think it can be a real game changer. What I want to be able to do is really minimize the number of fields that the humans see, without impacting anything that our integrations, flows or triggers might need. So my question is probably a silly one but, if I hide fields from the humans that are needed by the tech, is that ok? Will the tech still have everything it needs? Or do i need to test each workflow and integration when I change the visibility?
Thanks
SB
Comments: