Skip to main content

Hey Team,

 

I have a data lookup field (pointing to a SharePoint list) in one of my NAC forms. Let’s say the results can be Option 1 through to Option 10.

I then want to create a few rules based on the results of the data lookup, so if Option 1 is the result shown then show Group 1, if Option 2 then show Group 2 and so forth.

When I go to create the rule the lookup variable comes up as a form control, and I can insert it and define the rule, but when I go into preview to test it, the group shows regardless of which option is returned from the data lookup.

 

Any advice?

 

Thanks!

Hi @BJHutchison 

Step 1: Verify the value of the Data Lookup
Is the value of the Data Lookup correct? To verify, send the value to a Text control.
Changes to the Data Lookup control should be correctly reflected in the Result Text control

 

Step 2. Verify the Form Rules
This is going to be much much harder when there is multiple complex rules.

Turn off all the rules involved in to display the Groups. 
Enable the rules for Group 1.
If Option 1 is selected, is Group 1 shown?
If Option 1 is NOT selected. is Group 1 hidden?

Next enable the rules for Group 2 (and previous Group 1)
If Option 1 is selected, is Group 1 shown?
If Option 1 is NOT selected. is Group 1 hidden?
If Option 2 is selected, is Group 2 shown?
If Option 2 is NOT selected. is Group 2 hidden?

 

Also, Consider using the value of Result Text control value in the Form Rules.


I would recommend using the new "search" feature in rules to verify if you have other conflicting rules setup against the the group controls.

 

If that checks out i agree with Garrett with his last statement. Just create a text variable for your data lookup result and use that variable in your rule condition. 

 

At times rules are finicky with data lookups or data sources used. How many options are there? This can pose a problem since you have to do visible and hidden command meaning your rule has to say if option 1 then show group 1 otherwise hide group 1. 

 

You would need 10 rules to make this happen.

 

You may consider just doing a formula in the configuration panel for each group vs a rule. They work better than rules. 

 

Example, in group 1 click insert in visible field and type out the following:

 

data lookup control name=="option 1"

 

…if that doesn't work then switch the data lookup control reference to a text variable as mentioned above with the result of you lookup control. The formula above tells the form to only show the group when that condition is met. It will hide the group if it doesn't match.


Reply