InfoPath display or hide some section according to whether current user belong to SharePoint group

We have a lot of requirements to check if user is in some SharePoint group then display or hide some section in the InfoPath form.

This article will show you the steps to do it.

For how to get the SharePoint group in the InfoPath form please check http://blog.csdn.net/farawayplace613/article/details/8149167 .

This article is base on the result of the above article.

1. Create a SharePoint group in your SharePoint site, name the group as Admin, add your account into that group

2. Open the InfoPath form of the list,(see how to do it in my previous blog)

3. Add a section into the InfoPath form

InfoPath display or hide some section according to whether current user belong to SharePoint group_第1张图片

 

4.Add some text into the added section, and add one text box into, rename the text box as IsAdmin

5. Click the data tab, and click the "Form Load"

6. Add rule and name it as "SetIsAdmin"

7. Click the add action and select the "Set a filed's value"

InfoPath display or hide some section according to whether current user belong to SharePoint group_第2张图片

 

8. Select the added section, add a rule(select format for rule type), name it as IsAdmin.

9. Click the qiuck publish button of the InofPath form.

10. Try to create new  item of the list, the admin section should be showed:

InfoPath display or hide some section according to whether current user belong to SharePoint group_第3张图片

 

11. Remove your account from the admin group, try to add a new item again, now you can't see the admin section:

 

InfoPath display or hide some section according to whether current user belong to SharePoint group_第4张图片

 

 

你可能感兴趣的:(InfoPath display or hide some section according to whether current user belong to SharePoint group)