GetUserProfileByName fires on second change to dropdown - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

GetUserProfileByName fires on second change to dropdown

Last post 06-11-2021 10:00 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-10-2021 12:36 PM

    • SeanPRyan
    • Top 500 Contributor
      Male
    • Joined on 02-02-2012
    • Kansas City area
    • Posts 50

    GetUserProfileByName fires on second change to dropdown

    I have a connection file on my client's site. The InfoPath 2013 form should set the current user 3 nodes when the dropdown changes. I compare this with a hidden counter field which is blank on new entries prior to submit. When I choose an entry from the dropdown, hidden sections show. The people picker is within the section. The rules don't fill the field on the first try. Now, when I change the dropdown to another value, it fills as I'd like. In the Form load, I set the logged in user to a hidden field. I set the AccountName to this value and Run the Query. On the dropdown, I set the 3 nodes. Why does it work on the second try but not the first? I've tried changing the postback settings to always and this still occurs. I also created a new basic form on the same site where this does not occur. Thanks in advance.
    Sean
  • 06-10-2021 03:19 PM In reply to

    Re: GetUserProfileByName fires on second change to dropdown

    Any chance I can see a copy of your form? You can attach it to a reply under the Options tab.... Or send me an email via the forum, and I'll reply and you can attach it to my reply (forum email doesn't include attachments).
    Hilary Stoupa

  • 06-11-2021 09:54 AM In reply to

    • SeanPRyan
    • Top 500 Contributor
      Male
    • Joined on 02-02-2012
    • Kansas City area
    • Posts 50

    Re: GetUserProfileByName fires on second change to dropdown

    Thank you for answering, Hilary. I figured this out, so I hope this helps someone else. Found this interesting that I never bumped into this before, but you cannot set the value of a people picker out of the gate if it is inside a hidden section unless that section is within the same one that helps show that section. Field in Section 1: dropdown choice with values "New", "Old" Field in Section 2 (hidden until the ddl is changed to "New"): people picker. Rule, when Section1: dropdown changes, show Section 2 with the people picker inside it Rule On Load, or on Change for the dropdown: Set the current user using GetUserProfileByName. This won't work on form load and won't work the first time you change the dropdown. Interestingly, it will work the second time you select a value. In this instance, I want to show the Logged in user only after the dropdown unhides Section 2. So, I created a new nested hidden section inside Section 1 and called it HiddenUserSection. This is always hidden and I placed the people picker in here. This will update. Now, I placed a Calculated value in Section 2. I point this to the people picker. Now, that value loads and cannot be altered. I gave the calculated value borders to make it look like the other fields. :-)
    Sean
  • 06-11-2021 10:00 AM In reply to

    Re: GetUserProfileByName fires on second change to dropdown

    Great job & thanks for posting your solution to help others!
    Hilary Stoupa

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