Tuesday, March 12, 2013

Get SharePoint Users List from Infopath Form People Editor

Today I am doing some R & D with Infopath form & workflow. I want to pass multiple users from Infopath to workflow for multiple users' task creation.

I have searched on google but not getting proper result for above. That's why I have decided to write this post for other user's help.

See below image for visualization.



Now, fire button click & add below code.

        public void btnGetUsers_Clicked(object sender, ClickedEventArgs e)
            // Write your code here.
            XPathNodeIterator sentToIterator = MainDataSource.CreateNavigator().Select("/my:myFields/my:reviewersGroup/pc:Person/pc:AccountId", NamespaceManager );
            string result = "";
            int count = 1;
            foreach (XPathNavigator selectedNode in sentToIterator)
                if (count < sentToIterator.Count)
                    result += selectedNode.InnerXml +"; ";
                    result += selectedNode.InnerXml;
Happy SharePointing...!!!

No comments:

Post a Comment