Switching Views based on People Picker and the current user (username()) - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Switching Views based on People Picker and the current user (username())

Last post 04-08-2013 02:14 AM by Mel Balsamo. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-06-2013 11:23 PM

    • SPGeek
    • Not Ranked
    • Joined on 03-07-2013
    • Posts 1

    Switching Views based on People Picker and the current user (username())

    Hi,

    I have created a web form where in the initial view a user enters the director's name in a people picker field.  How can I switch to a Director's view of the form where the director's name in the people picker is compared against the current user viewing the form?  I have tried to compare the people picker DisplayName and the AcountID against username(), but neither seems to work because the returned values are different?  Does anybody have any suggestions? Thanks.

  • 03-07-2013 06:02 AM In reply to

    Re: Switching Views based on People Picker and the current user (username())

    Have you tried using the contains() function instead of comparing if they're equal? There might be extra characters in the People Picker value that's just not displaying. So your rule would be something like: if AccountID contains username(), then switch view.

    If that still doesn't work, try using the SharePoint list UserProfileSevice web service, GetUserProfileByName method.

    Mel Balsamo
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 04-08-2013 01:55 AM In reply to

    • busola
    • Not Ranked
    • Joined on 04-08-2013
    • Posts 1

    Re: Switching Views based on People Picker and the current user (username())

    Thank you Mel,

    The contains() function works very well.

  • 04-08-2013 02:14 AM In reply to

    Re: Switching Views based on People Picker and the current user (username())

    Glad to hear it's working! :)
    Mel Balsamo
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

Page 1 of 1 (4 items)
Copyright © 2003-2014 Qdabra Software. All rights reserved.
View our Terms of Use.