cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Australe
Frequent Visitor

Populating correct phone number

I'm learning PowerApps as I'm going along. Our company is in progress of onboarding to Office 365. I'm working on building out a Phone Directory that will pull from Office365Users connection. 

 

In my directory search, I'm trying to create a popup window that will come up when a User is clicked to provide more information. I'm struggling with getting the phone number to populate properly. 

 

I've tried to set variables to help pull the information, that was almost successful. It only pulls the top phone number though, not the selected User. In my screenshot you'll see that the Phone number that's populating is coming from the Secretary's Phone. My expectation is to have the Phone field for Kirstin populate here. When I try "Phone: " & _selectedUser.TelelphoneNumber it only pulls the mobile number, not the correct Telephone Number field. 

Can you please help me figure out what I'm missing? I'm stuck. Thank you in advance for your time. 

 

1 ACCEPTED SOLUTION

Accepted Solutions

My apologies for the delay in my response, it's been a busy week. 

The BusinessPhones field is coming through the Office365Users connector, I am not using an additional data source. I tried the settings you recommended without success. However, I made some tweaks to my forumla based on the variable you recommended that I set. I was setting the variable with 

Set(_selectedUser.ThisItem)

I changed my variable to this instead

Set(_selectedUser,UserBrowseGallery2.Selected)

 

Using this in the phone field properly populated the field for me. With the variable set the first way I was not getting the proper result, after the variable tweak everything seems to be working properly. 

"Phone: " & First(_selectedUser.BusinessPhones).Value

 

Thanks for your help!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Australe ,

 

You can try this formula in a label to get all the standard attributes out of AD:

 

Office365Users.UserProfileV2(YourPeoplePickerdropdowncontrol.Selected.Email).mobilephone

 

Delete the  mobilephone and . then press the . again- After the . scroll through what attributes come up in the intellisense menu at the bottom of the formula bar to see what is available from your office 365 users connector.

 

You might need to update your AD to ensure the business phones are set up correcty.

 

DanielRK_0-1648756520178.png

 

Please let me know if this helps you.

 

Regards,

 

Daniel

Thank you for the information, I was unable to get this to resolve properly. TelephoneNumber for some reason keeps pointing to mobile number, I know this isn't uncommon. 


I used this on the main list of my results to bring forth the phone number, but it doesn't work on my popup on the same screen. 

"Phone: " & First(ThisItem.BusinessPhones).Value

 

Is there a way that I can set this variable ( lblPhone ) and have it pull over to the popup that's on the same screen? 
I tried to user Set(_worknumber, lblPHone)  It only pulls from the first item in the gallery though and NOT the selected user. 

Anonymous
Not applicable

So are you saying that this formula returns the correct result in one context in your app but not in another? Is  BusinessPhones a field coming from your datasource (IE not from the office365 Users connector)?

 

Perhaps you can set the item property for the form as a global variable. So on the Onselect property of your gallery (I'm assuming that's how you're getting to the specific contact car), put:

 

set(varContactData, Gallery.Selected)

 

Make the item property of your form

 

varContactData

 

(or name it how you like as long as the variable name being set is the same as the variable name in the item property of the form control).

 

Then you can put this into your label:

 

varContactData.BusinessPhones

 

Please let me know if I understood your requirements right?

 

Thank you.

 

Regards,

 

Daniel

My apologies for the delay in my response, it's been a busy week. 

The BusinessPhones field is coming through the Office365Users connector, I am not using an additional data source. I tried the settings you recommended without success. However, I made some tweaks to my forumla based on the variable you recommended that I set. I was setting the variable with 

Set(_selectedUser.ThisItem)

I changed my variable to this instead

Set(_selectedUser,UserBrowseGallery2.Selected)

 

Using this in the phone field properly populated the field for me. With the variable set the first way I was not getting the proper result, after the variable tweak everything seems to be working properly. 

"Phone: " & First(_selectedUser.BusinessPhones).Value

 

Thanks for your help!

Anonymous
Not applicable

Hi @Australe ,

 

Thanks for posting back with this solution. You should mark it as the solution so other users having the same issue can find it.

 

Well done!

 

Regards,

 

Daniel

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,268)