Basic Idea: Use the WebService provided by SharePoint to obtain the role (Web Url/_ vti_bin/usergroup. asmx? WSDL ).
1. Call the method GetGroupCollectionFromUser in usergroup web Service, input the AD account string of the parameter process initiator, and output the XML file.
2. parse the XML file using XSLT to obtain the role set of the Process initiator.
Figure:
Detailed Execution Process
Use Send Notification to view the XML file of the output location
Code
<xml>
<GetGroupCollectionFromUser xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<Groups>
<Group ID="4" Name="Absence Requests Owners" Description="Use this group to give people full control permissions to the SharePoint site: Absence Requests" OwnerID="4" OwnerIsUser="False" />
</Groups>
</GetGroupCollectionFromUser>
</xml>
The detailed XSLT code is as follows:
Code
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:h="http://schemas.microsoft.com/sharepoint/soap/directory/">
<xsl:template match="/">
<xsl:for-each select="xml/h:GetGroupCollectionFromUser/h:Groups/h:Group">
<xsl:value-of select="@Name"/>;</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Parse the role set and use ";" to separate each array element and output the following string:
Absence Requests Owners;
If the initiator user belongs to multiple users, it is shown as follows: Absence Requests Owners; HR; Payroll;
Process File download: download