How To: Check if a user is part of a SharePoint group in InfoPath

http://www.projectpoint.at/?p=97









Once that is done, close the form and navigate to the location where you exported your form to. Open the file named “GetUserCollectionFromGroup1.xsd“. This file defines the XML schema. Open the file in a text or XML editor. The following steps can be found in Ian’s blog. Thanks again!
Right under this code within the file:
1
<s:import namespace="http://www.w3.org/2001/XMLSchema"></s:import>
insert the following snippet:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<s:complexType name="GetUserCollectionFromGroupType">
 <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="Users">
   <s:complexType>
    <s:sequence>
     <s:element maxOccurs="unbounded" name="User" >
      <s:complexType>
       <s:attribute name="Notes" type="s:string"></s:attribute>
       <s:attribute name="Name" type="s:string"></s:attribute>
       <s:attribute name="IsSiteAdmin" type="s:string"></s:attribute>
       <s:attribute name="Sid" type="s:string"></s:attribute>
       <s:attribute name="ID" type="s:string"></s:attribute>
       <s:attribute name="LoginName" type="s:string"></s:attribute>
       <s:attribute name="Email" type="s:string"></s:attribute>
       <s:attribute name="IsDomainGroup" type="s:string"></s:attribute>
      </s:complexType>
     </s:element>
    </s:sequence>
    </s:complexType>
  </s:element>
 </s:sequence></s:complexType>
Now locate the following piece of code within your file:
1
2
3
4
5
6
7
<s:element name="GetUserCollectionFromGroup">
  <s:complexType> 
    <s:sequence> 
      <s:element minOccurs="0" maxOccurs="1" name="groupName" type="s:string"></s:element>
    </s:sequence> 
  </s:complexType> 
</s:element>
and replace it with this:
1
2
3
4
5
6
7
8
<!--<s:element name="GetUserCollectionFromGroup">  <s:complexType>     <s:sequence>       <s:element minOccurs="0" maxOccurs="1" name="groupName" type="s:string"></s:element>    </s:sequence>   </s:complexType> </s:element>--><s:element name="GetUserCollectionFromGroup" type="tns:GetUserCollectionFromGroupType" />
We are almost there J Now save the file and open the manifest.xsf by right clicking it and select Design.
If you have a look at your GetUserCollectionFromGroup data source and its fields, you will notice that it has changed

No comments:

Post a Comment

SPFX - HTTPClient - Curd Operations - SharePoint list.

  Create solution in the name of SpfxCrud. ISpfxCrudProps.ts export interface ISpfxCrudProps {   description : string ;     context : an...