web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populating correct pho...
Power Apps
Answered

Populating correct phone number

(0) ShareShare
ReportReport
Posted on by 27

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. 

 

2022-03-31 14 59 07.jpg
Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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

  • Australe Profile Picture
    27 on at

    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

     

  • Australe Profile Picture
    27 on at

    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. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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

  • Verified answer
    Australe Profile Picture
    27 on at

    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!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard