Right-click on the CurrentUser field in the fields section and select.
Set the condition to IsAdmin = Is blank.
Create a new formatting rule and name it Hide From Non-Admin Users.
Click on the section tab that contains your restricted content.
The final Rule Details dialog should look similar to the image below:.
Click OK several times to close all dialog boxes.
Select the userName function and click OK.
On the Insert Formula dialog, click the middle button.
From the third drop-down, select Use a fornula.
Accept the default in the second drop-down: is equal to.
On the Data source dialog, under dataFields, drill down and select.
In the first drop-down box change ID and click Select a field or group.
Under dataFields, drill down and select ID.
Change the data source to GET-ElevatedPermissionsUsers.
Create a new Set a field's value action:.
Accept the default Condition - None - Rule runs when form is opened.
Create a new Action rule and name it Assign Admin Users.
In the Rules section, click on the Form Load button.
Accept the defaults and complete the wizard steps.
Add a new connection to the ElevatedPermissionsUsers list and name it.
Format and change themes to your liking.
Add the Manager and EmployeeAction fields in the new table.
Insert a Two-Column with Emphasis 3 table layout in the new section.
Add a new section to the bottom of the form.
Delete the last four rows including the fields, Manager, CurrentUsaer, IsAdmin and.
On the list ribbon, click the Customize in InfoPath button.
IsAdmin field, however they can be any field type For simplicity I kept them as single lines of text except the It can be based on a Custom list template, or any other list template that you need, such as Tasks.įor this excersize, I've created a custom list and named it RestrictedInfoPathSections. If you don't already have a list form that you need to customize, create one now. Now that your list is ready, add a couple of site users to the list.
Add Edit (link to edit item) and move it to the first column.
Change the Item content type and hide the Title field.
In Advanced Settings, Allow management of content types.
Accept the defaults for everything else.
Create a custom list and name it ElevatedPermissionsUsers.
We will reference this list in a data connection in InfoPath. In order to restrict sections in a form, we will need to create a list that contains the users who will have access to the section.