I have finally been able to release the new version of DFFS where I have fixed several issues and done a major overhaul of the trigger handling to fix some problems with rule order when using multiple rules on the same field.
A special thanks to Rudolf Vehring for his help with testing of all the changes in this release.
Here is a tool to toggle the visibility of all custom lists (BaseTemplate 100) and document libraries (BaseTemplate 101) – and also the Site Pages library (BaseTemplate 119). It is used to toggle the Hidden property on the list – which determines whether or not to show the list in Site Contents.
Please note that you must have the necessary rights (manage lists) to use it, and if you don’t you will get an error message. Also note that this snippet loads jQuery from code.jquery.com – if your site does not have Internet access you must change this script tag to refer a local copy of jQuery.
Add this snippet to a Script Editor Web Part in a Classic Web Part Page to use it.
One of the main areas of confusion when using DFFS is the automatic rule reversing of rules that are NOT evaluated to true.
This example show how most users first set it up and ends up with the wrong result. I’ll first show how it is set up to make it fail, and then I’ll highlight the missing part at the bottom of this post.
The example form
Let’s say you have a choice field TabVisibility that controls the visibility of a specific tab. For this example I have created a choice field with two values: Show and Hide, an have set up three rules.
Tab is set to hidden but this will not work because the rules show below will override it.
One for hiding the tab when the TabVisibility choice field is empty:
One for showing the tab when the value is Show:
And one for when the value is Hide:
This is how it looks when loading NewForm and the value in TabVisibility = blank, but it is not doing what you expect:
This must be wrong – the tab is not hidden???
Why this is not working
When you have trouble with a form you should always use the Debug this rule setting:
This will show you the debug panel below the form:
When the form loads, each of the three rules are evaluated. The first rule is evaluated as “true” and hides the tab as it should:
Hides the tab.
Then the next rule runs and is evaluated as “false” and does the opposite of what it is configured to do. It doesn’t do anything wrong here because the tab is already hidden, but you see where this is going:
Should show the tab if true, but reverses and hides the tab instead.
Then the last rule comes in and messes it up by showing the tab despite it being set up to HIDE the tab and not to show it:
Shows the tab because the rule is reversed when not evaluated to true.
Why is this happening?
The reason for this behavior is to avoid writing two rules for every action and just let DFFS handle the reversing – for example if a Yes/No field is checked: show some fields, set some fields required etc. Then if the field is unchecked, all visible field are hidden, required fields are set as optional etc. This is by design to limit the number of rules required to make a dynamic form.
This will however create problems when you use multiple rules on for example a single choice column as described above.
How to fix it
In this scenario you must use the No reversing of this rule setting in each of the three rules (optionally you can check the Disable reversing of all rules in the top of the Rules tab):
No reversing set on each rule.
When you have done this your NewForm will load correctly and hide the tab:
That’s it – post any comments below, or use the forum.