Dynamic Forms for Community (Experience Cloud)

Dynamic Forms for Community (Experience Cloud)
Photo by Hans Eiskonen / Unsplash

The OOTB feature of Dynamics Forms allows user to show and hide fields based on certain criteria derived; again from the fields. A very useful feature but not supported in communities. As a result projects end up redesigning and reworking the entire detail page layout in a custom way which becomes complex as the conditions grow.

Also, Dynamic Forms can only show/hide fields conditionally but cannot make them read-only conditionally. Also most of the community based project requires a wizard-cum-questionnaire structure wherein as the user updates the field, the next set of questions (fields) should be shown/hidden/made read-only based on certain conditions etc.

Introducing edf.

Extreme Dynamics Forms (hereafter referred as EDF) is a generic LWC component that can behave as Dynamic forms that work for Communities as well.

It leverages a client side Decision Engine built using pure Javascript that can compile and evaluate any configured boolean expressions against the record onto which the component is added and configured.

Features

  1. Dynamic Forms supporting communities.
  2. Conditionally show-hide fields and/or make fields read-only and vice versa based on criteria encompassing fields of the same record.
  3. Easy setup - Quickly generate form definition records derived from any existing page-layout of an object with a button click.
  4. Configure conditions in the form of complex boolean expression including brackets (, ) for precedence e.g. (custom_field1__c = “some text” && standardField1 == 100) || custom_field1__c = “some other text”
  5. Supports fields in both LHS and RHS of an expression [Not supported in OOB Dynamic forms].
  6. Supports parent fields in expression.
  7. Supports composite fields viz. Name field on Contact and Address fields in expression. E.g.
  8. Component configuration is quick - simply drag and drop on the record detail page layout and select the Form Definition Version.
  9. Decision engine works seamlessly on load and also on change of fields value on the fly.
  10. No server calls since the decision engine runs completely at the client side - making the overall experience performance rich.
  11. Not just fields - EDF can also be configured to conditionally toggle sections (containers).
  12. Can be extended to implement client side validation using HTML snippets as Form elements.
  13. Custom Label for fields.
  14. Conditional labelling of fields.
  15. Debug Mode for Admins.
  16. Support for Multi-Select picklist field in expression. Use ~ and !~ operators that work as includes/contains and doesn't include/doesn't contain respectively.

Solution is now available for free on AppExchange

Extreme Dynamic Forms
A generic LWC component - an extension to Dynamic forms. Supports Communities (Experience Cloud). It uses a client side Decision Engine built using pure Javascript that can compile and evaluate any configured boolean expression to show and hide fields.

About the author
Muralidhar Sampathirao

Muralidhar Sampathirao

Sr Technical Consultant @ Salesforce • With thrdz I am designing the building blocks for Enterprise Applications • Articles, opinions and resources expressed/shared are entirely my personal views.

THR(EA)DZ

DZining the building blocks for Enterprise Applications

THR(EA)DZ

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to THR(EA)DZ.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.