Build 'Dynamic' Forms

I’d like to build ‘dynamic’ forms, which can be specified by rules and not just in the page builder.

I have a need to create a set of Forms that link to a table. But each Form is subtly different, and uses a different combination of fields.

There are about 30 fields in the table in total, and each Form will use a different select of about 6 fields.

Of course I could create lots of Form pages, but I want to try something smarter, and easier to manage.

I know I can also do this with Form - Display - Rules and they work well.

But these rules only affect the ‘Display’ of the fields. All the fields in the table are in fact rendered to the page and the display rules control which are turned on and which turned off.
I am concerned as this may cause a page load delay, and also potential data leakage.

I wonder if there is a way to set which fields are rendered in the first place?

Ideally I would like a way to set up rules like the Display - Rules which are in fact Render - Rules. Any ideas how to acheive this ? Is it possible?

Hi @mtif -

To load a page dynamically, I am assuming you have some type of data field that will have some type of content that will dictate what to “render”. For example, Person type could be an employee, client, regulator. Depending on what that field shows could by the dynamic input to tell the system what form to load.

If that is the case, what is that in your use case? If you require the form to dynamically render after a person has selected an option in the form, that will drastically reduce the options for presenting.

Either way, I have forms that have more than 30 fields and the display rules have never been an issue on page loading or operation. I have used a multi-step form to help with the the “look and feel” (aka formatting) when the different fields are shown or hidden. The multi-step form can be completed in a couple of different options.

Option 1:
Use the multi-step form option built into the form component (“add step” button at the top of the form in page builder)

Option 2:
Build a multi-step form that requires the saving of data to move to the next step.

Option 3:
As you noted, create multiple form pages and then develop an equation formula with html built into the formula to make it look like a details page button and when the dynamic field is loaded in the table, the button will automatically change to the identified form.

Example equation formula that creates a Details button:

IF({Event Type}='Exercise',CONCAT('<a',CHAR(32),'href="https://XXXX.XXXXX.XXX/#!/exercises-incidents/exercise-details/',{RecordID},'"',CHAR(32),'class="btn',CHAR(32),'btn-info',CHAR(32),'td-data-link"><i',CHAR(32),'class=" fa',CHAR(32),'fa-fal',CHAR(32),'fa-file-alt"></i>',CHAR(32),'Details','</a>'),CONCAT('<a',CHAR(32),'href="https://XXXX.XXXXX.XXX/#!/exercises-incidents/incident-details/',{RecordID},'"',CHAR(32),'class="btn',CHAR(32),'btn-info',CHAR(32),'td-data-link"><i',CHAR(32),'class=" fa',CHAR(32),'fa-fal',CHAR(32),'fa-file-alt"></i>',CHAR(32),'Details','</a>'))

Happy to help more if you need additional

Thanks so much for your ideas. And your reassurance that the Form Display Rules work well even when the number of fields in the table starts to grow. That gives me confidence that the way I am working will work … but I have to be honest I am still looking and thinking about an alternate approach.

Fundamentally Page Display Rules work at the display level, and affect display CSS. Therefore all form fields are in the page, but many can be hidden. I’d prefer they weren’t there unless needed.

And thanks too for the prompt on creating a concatenated HTML field. I realise the power of that method to create a variable/dynamic HTML output. And then to use that handlebars/html in a Custom Component.

I am now wondering how great it would be if the Custom Component could also handle Forms, as well as details/table/summary pages?

Because using the Custom Component I can create a dynamic table (where the fields selected to display in the table are driven from a complex calc. text string)

Or at a pinch, if there is someway to enable ‘inline editing’ for a Custom Component Table, then I might not need a form.

Thinking caps on :wink: