Search in Person/Group Picker - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Search in Person/Group Picker

Last post 09-19-2012 04:25 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-19-2012 06:51 AM

    • Carel
    • Not Ranked
    • Joined on 09-14-2012
    • Posts 7

    Search in Person/Group Picker

    I am currently having trouble searching for a specific person within a person picker with multiple values. What I have is a List with departments unique to each list item and for each department a set of capturers stored in a person picker who are allowed to capture a data set for the specific department. When a user fills in a new form, he should be unable to submit if he is not a capturer for the department which he selects (from a drop-down list).

    I have tried to use the infamous 'double eval trick' to pull the account ids from the picker in the SharePoint list into a field in InfoPath, but to no avail. I'm quite confident in my xpath but I'm plagued with the somewhat well known error when I run the form:

    Reference to undeclared namespace prefix: 'pc'.

    Xpath as follows:

    xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("AccessControl")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Capturers/pc:Person[../../d:Department = xdXDocument:get-DOM()/my:myFields/my:Department], 'concat(pc:AccountId, ";")'), "..")

    the 'pc' that is undeclared would be the one used with AccountId that is contacted with the ; Basically, all I need to do is check if the currently logged on user is in the picker with multiple values in a specific list item. Any thoughts on how to accomplish this will be greatly appreciated.
  • 09-19-2012 04:25 PM In reply to

    Re: Search in Person/Group Picker

    Hi Carel,

    Is the people picker in the form or just the list? If it's not in the form, maybe the namespace isn't either. Just adding it to the form should be a good test of that.

    In general, the data source the people picker gives you is not easy to use for other purposes (such as workflow). I recommend, just defining your own structure and call UserProfileService to populate the value. Especially, if you don't need more than one person, that is going to be far simpler. Check out Clayton Cobb's UserProfileService blog for how to do that.

    To check membership, you don't need a double eval. You should be able to do this with a straight xpath on the secondary data source. Does the secondary data source contain all of the items? If so, should be straightforward but tricky. Jimmy Rishe or Hilary Stoupa would be good people to reach out to when it comes to tricky xpath.

    Good luck,

    P

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.