Solved

Office 365 Query User Profile Action guide

  • 8 September 2015
  • 10 replies
  • 51 views

Badge +3

Has anyone successfully used the O365 Query User Profile Action with User Column in a SharePoint list and get proper data back?

 

I am trying to get the manager for a particular user assigned in the form. When passed in the User Email, it kept throwing an error .  When i dump the user data into the history it looked like i:0#.f|membership|firstname.lastname@trial.onmicrosoft.com. Is this an overlook by the Nintex team that the user column would contain claims?

 

So far I could only use it properly if I use the action with the Workflow Context for Initiator and Manager but can't be used for any other users.

 

Any ideas?

icon

Best answer by andrewg 8 September 2015, 22:30

View original

10 replies

Userlevel 7
Badge +17

That still looks like the user's account login, not their email address. Did you use the Format This Value feature on the User Column to return just the email address? If not, it is returning the account login and will not be able to find the user.

More details here on Format this Value: Using the Format this Value Feature

Badge +3

Andrew , you are right on using the the format value. The placeholder values are very misleading as you can't see what you actually choose to show.

Badge +11

But is there any way of getting the phone number or any other useful info in the profile?

Userlevel 7
Badge +17

Yes, in the Property setting you set with the name of the property you need back, such as Phone. http://help.nintex.com/en-US/O365/#O365WorkFlow/Workflow Actions - INT/Office 365 Query User Profile.htm

Badge +11

But this needs a password. Users opening forms or running workflows have already been authenticated. They should already be able to look up info such as a phone number. Why should a password be necessary? Can I query the user profile without a password. If I setup my password and ID here, will I need to change it on the workflow everytime I reset my password... it would seem so...which would make this a real bother (when everytime my password is changed, workflows break). Is there a way around setting a password. I really do not want to ask our security folks to create a bespoke account for this. Like a SharePoint App Step, there should be a way of running it with publisher's permissions - Is there?

Userlevel 7
Badge +17

That's a great suggestion to not require credentials if used within an App Step. I would post that  here 3 - Nintex Workflow for Office 365: Hot (141 ideas) – Customer Feedback for Nintex

But you may be able to use a rest call within an App Step to do the same thing.

Get all properties of Specific User

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|username@siteurl.onmicrosoft.com0%23.f|membership|username@siteurl.onmicrosoft.com'

Get Specific UserProfile Property of Specific User

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='WorkPhone')?@v='i:0%23.f|membership|username@siteurl.onmicrosoft.com0%23.f|membership|username@siteurl.onmicrosoft.com'

Badge +11

Done - but seems I've been doing that a lot since recently..."Publisher Action" Setting on Query the User Profile action, not requiring a fixed password, using the publisher's permi…

Badge +9

https://tenant.sharepoint.com/_spi/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0#.f|membership|daniel.westerdale@tenant.onmicrosoft.com'

I get a 404 error when I test against my actual tenant using Postman.  Note, I have run the interceptor to login into the tenant.

Anybody else attempted this?

Badge +9

As aside, looking at the (sparse) documentation, if I use the alternative Office 365 Query Profile Action, then I have a configure each one per property.  It works ok tho with what ever email format I have entered for the test user.

when passing the email id in the query user profile action, please truncate the extra chars prefixed with email id in person type column. Then it will get the required property.

To get the phone number, SharePoint person type column will be sufficient. No workflow is needed.

Reply