Show/Hide controls in InfoPath Form for SharePoint Lists – Part II

Published by Satyajit Paul on

Show/Hide controls in InfoPath Form for SharePoint Lists – Part II

This article is the continuation of the previous article found here

Step 5: Create a flag for leadership user

In this step, we will create a rule to identify if the logged in user is from Leadership. Let us name the rule “Confirm Leadership user”. All the steps are the same as Step 2, except the fields changes to “isCurrentUserLeader” and one of the filter conditions form Permission Level changes to “Leadership. The changes are reflected in the screenshots below – 

Step 6: Hide the HR section for non-HR users

In the section for HR, add a formatting rule named “Enable HR view”. In the condition, select isCurrentUserHR and set the condition as “is blank”. After these changes are made, check the setting “Hide this control”

Step 7: Hide the Leadership section for non-Leadership user

Similar to Step 4 above, add a formatting rule named “Enable Leadership view”. In the condition, select isCurrentUserLeader and set the condition as “is blank”. After these changes are made, check the setting “Hide this control”

With this, all the steps are completed. Publish the form now. Time for testing it out!!

Step 8: Usage and Testing

Now, if you do not have any entry in the Permission Configuration list, both the sections will be hidden from you. 

If your entry is added as “HR”, you will be able to see the HR section – 

And if your entry is added as “Leadership”, you will be able to see the Leadership section –

Finally, if two entries are added against your name for both HR and Leadership, you will be able to view both the sections

This concludes the article! Thanks for stopping by, and have a nice day!

Care to Share?

Satyajit Paul

SharePoint Developer with 6+ years of experience. Skilled in Add-in Development, BPM, CSOM and Migrations.

0 Comments

Leave a Reply