cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DJB22
Level: Power Up

SQL/O365 - Checking common fields and displaying the O365 UserPhoto.

Hi Everyone!

 

Im currently working on a staff directory using powerapps and I need ideas on how to proceed.

 

I need to pull Office365 profile picutres (using the O365Users Connector) and match them with the corresponding staff record (from our SQL database, using the SQL Server Connector).

 

Currently, the records are being displayed in the gallery and Im filtering the gallery using a search bar. Once the user finds the record they want, they click the arrow button which populates the right-hand-side information screen. 

 

SD.PNG

 

So my issue is finding a way to "check" the common fields ('Email' OR 'Initials') and display the O365 profile picutre (UserPhoto). 

 

For example: When I press the gallery button, the app should check the SQL Email with the O365 Email and if both match then display the selected users O365UserPhoto.

 

If you need any further clarification on anything, feel free to leave a comment.

 

Any ideas/solutions is much appreciated.

 

Thankyou!!!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
myke_deabreu
Level 8

Re: SQL/O365 - Checking common fields and displaying the O365 UserPhoto.

Hi Djb22,

 

For you to get the Profile Picture you need to get the users O365 ID. You could use the UPN or Email address to get this.

 

Try the following:

 

Set the Image function of your media image to

 

Office365Users.UserPhotoV2(First(Office365Users.SearchUser({searchTerm:**EMAILADDRESS**})).Id)

 

Let me know if this works.

 

There could be an easier way just not to sure how your app is setup but that should do the trick.

3 REPLIES 3
myke_deabreu
Level 8

Re: SQL/O365 - Checking common fields and displaying the O365 UserPhoto.

Hi Djb22,

 

For you to get the Profile Picture you need to get the users O365 ID. You could use the UPN or Email address to get this.

 

Try the following:

 

Set the Image function of your media image to

 

Office365Users.UserPhotoV2(First(Office365Users.SearchUser({searchTerm:**EMAILADDRESS**})).Id)

 

Let me know if this works.

 

There could be an easier way just not to sure how your app is setup but that should do the trick.

DJB22
Level: Power Up

Re: SQL/O365 - Checking common fields and displaying the O365 UserPhoto.

YES THATS IT!! 

 

Omg absolute legend. 

 

Cheers for the help.

myke_deabreu
Level 8

Re: SQL/O365 - Checking common fields and displaying the O365 UserPhoto.

Thanks DJB22 - Glad I could Help!

 

Happy Apping!

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 255 members 4,162 guests
Please welcome our newest community members: