User Profile Service in O365 - Bre Huston
in

InfoPath Dev

Bre Huston

User Profile Service in O365

Hello everyone!

Here's a trick I use in O365 and SharePoint 2013 to get around some rather nasty Web Service query errors in the browser. I'm sure some of you have tried to use this service, and experienced the error.

Many times data connections are set up within your for to query on load. This is not best practice for 2 reasons.

1. Querying data before you need it can create poor form performance
2. In certain cases, such as the user profile service, your query will fail if set to automatically query on open. 

So then, how do you get around this behavior if you want to use the service?

ANSWER: Delay the querying of information from the service by unchecking the option to automatically query.

In this instance, It becomes very important to set the query value of the data connection. On the form Load rules in the designer, set the query accountName value to the userName() function, and hen add a rule to query. Publish your form to your site and watch the magic happen!  

I have attached the sample for some experimenting. Simply change the user profile service url to your own site and publish.

If using 2013 there's one extra step. You'll need to change the AccountName query value to not include the claims identifier.

Use this formula to set the username without the claims identifier:

substring-after(userName(), "i:0#.w|")

Comments

 

User Profile Service in O365 - Bre Huston | Sha... said:

Pingback from  User Profile Service in O365 - Bre Huston | Sha...

June 1, 2015 7:59 AM
 

Sailor said:

Thank you a million times!  My head was almost bleeding from the pounding until I found this simple solution!!!

September 17, 2015 8:12 AM
 

Sheila said:

Can you help? I don't understand this statement: " On the form Load rules in the designer, set the query accountName value to the userName() function, and hen add a rule to query. "

I have my UPS data connection, I have unchecked to load on open, and then I go to Form Load and I get lost on these instructions. Also, I AM in SP2013 Online. Thanks so much!

January 19, 2017 11:27 AM
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.