Can I set a default value for People Picker - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Can I set a default value for People Picker

Last post 03-13-2019 11:42 AM by Michael Boonie. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-08-2019 01:05 PM

    Can I set a default value for People Picker

    Hi, all.

    As I recall, in the past, I was able to set the default value of a People Picker control by setting it's AccountID value on Form Load. That trick no longer seems to work for me.

    I'm using Windows 10 and SharePoint Online. The form is a proper browser-enabled Forms Library form, not a customized List Form (although that doesn't seem to make a difference.) On Form Load, I set the AccountID value of the control to the email of the current user. I have (temporarily) placed calculated-value controls on the form, so I can see what the value of everything is, and while I can see that the AccountID was indeed set, the DisplayName and Account Type are still blank. I've also tried this with the un-trimmed username(), including the funky preface "i:0#.f|membership|...", but that didn't help.

    Has anyone else been able to accomplish this using SPO and a browser enabled form? It seems a little lame to have to ask the user to pick their own name!

    Thanks in advance for any help or insight...

    -Boonie
  • 03-08-2019 02:43 PM In reply to

    Re: Can I set a default value for People Picker

    Hi Boonie: Sorry I can't help because I'm on SharePoint 2013. But I'm trying to do the same thing. I was trying to set it using a calculated value and username() but the name just gets updated with the next person who opens the form. Since you used the form load rule before, what version of InfoPath and SharePoint were you on?
  • 03-08-2019 03:36 PM In reply to

    Re: Can I set a default value for People Picker

     I just tried this on a form I have published to my SharePoint Online site - and I get an error when I query the user profile service. I'm pretty sure this form used to work.

    An error occurred while trying to connect to a Web service.

    An entry has been added to the Windows event log of the server.
    Log ID:5566

    This is the same error we used to see on SharePoint on-prem when loopback check wasn't enabled - and if I remember correctly initially this web service didn't work in SharePoint Online.

    You could try changing to UDCX with an SSO app id - I'm not at all sure that's going to work, but it could be worth a shot - outlined here in method 2 (it says IP 2010 - but the steps to using UDCX are the same): https://support.microsoft.com/en-us/help/981684/when-you-connect-to-a-web-service-by-using-an-infopath-2010-form-that

    Hilary Stoupa

  • 03-08-2019 03:39 PM In reply to

    Re: Can I set a default value for People Picker

    Hey, Teddybeardog - just add a condition to not set your field if it already has a value in your rules. Then it only gets set when the form is new & doesn't get updated every time someone else opens the form. :-)
    Hilary Stoupa

  • 03-13-2019 11:42 AM In reply to

    Re: Can I set a default value for People Picker

    Wait... am I to understand that one can now use User Profile Services with SPO? I didn't know they "re-enabled" it.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.