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

Community site session details

Session Id : BZU+Kephqbk2fNmgPePm4N
Power Apps - Building Power Apps
Answered

display selected users profile details

Like (0) ShareShare
ReportReport
Posted on 24 Sep 2020 09:22:13 by

Hi

 

I think a very simple one, but cannot figure out.

I want to be able to display the telephone number of the user which is selected in datacardvalue2 (SPO person field) rather than display the number of the user who is logged in

 

  • Community Power Platform Member Profile Picture
    on 01 Oct 2020 at 07:41:52
    Re: display selected users profile details

    Thanks, your advise is appreciated

    yes the tests worked, but had to make another change, when someone clicked the gallery, then click the new icon, it would still retain the mobile number as the vItem was set when the user clicked the gallery item, so had to set vItem to blank when the user selected the new icon to create a new record - seems to work....

     

    Thanks heaps for your help on this

     

     

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on 30 Sep 2020 at 14:54:58
    Re: display selected users profile details

    Hi!

     

    Yes that's right - If using a form then I would normally do a check for IsBlank(Parent.Default), but since you are using a variable/collection to display afterwards then you would need to modify the formula to check for that first.

     

    What you have done looks right to me, what did the tests reveal?

     

    Cheers,

    Sancho

  • Community Power Platform Member Profile Picture
    on 30 Sep 2020 at 13:23:53
    Re: display selected users profile details

    Hi @iAm_ManCat  (Sancho)

     

    Slight problem, when I re-visit the submitted record, it doesnt display the number if it was entered manually as some profiles are empty.

    The way I view my submitted item is via a variable called vItem, via a gallery, could you help me change your suggestion to include if the field is blank and if vItem is blank, then to look at the office365users.userprofile else to use vItem, do you think this is right, it seems to be but havent fully tested:

    If(
     !IsBlank(vItem), vItem.TelephoneNumber,
     
     //If business Phone Blank then use Mobile Phone
     IsBlank(
     Concat(
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).businessPhones,
     Value
     )
     ),
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).mobilePhone
     ,
     //Otherwise if businessPhone not blank then use the businessPhone
     Concat(
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).businessPhones,
     Value
     )
    )



     

  • Community Power Platform Member Profile Picture
    on 24 Sep 2020 at 15:33:46
    Re: display selected users profile details

    Hi @iAm_ManCat 

     

    You were right 🙂 your first suggestion was giving me that error in edit mode because there was no person selected in the field, I have tried my profile and it didn't display my number, tried another users account and that picks up a valid number, so now I need to figure out which field its looking at from Delve or AAD.

     

    Tried your new suggestion and that doesn't work, gives an error in edit mode and doesn't provide me with a contact number, i guess its not a big deal as your first suggestion did provide the answer I was looking for:

     

    G99_0-1600961435140.png

     

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on 24 Sep 2020 at 15:18:19
    Re: display selected users profile details

    Hi,

     

    Is there a Person currently selected in the box?

     

    It can't do the lookup when there's no ID, so I think if you wrap the whole thing in a CountRows so that it won't even look when there's nothing selected then that might help with it:

     

    If(
     //If business Phone Blank then use Mobile Phone
     Countrows(DataCardValue2.Selected)=0,
     ""
     , 
     If(
     IsBlank(
     Concat(
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).businessPhones,
     Value
     )
     ),
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).mobilePhone
     ,
     //Otherwise if businessPhone not blank then use the businessPhone
     Concat(
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).businessPhones,
     Value
     )
     )
    )

     

    Could you try that and let me know if there's any further issues? Also if you could maybe test it in Play mode to see if it's only in the editor or if it happens in play mode too, as it may just be a runtime error where it can't look up the ID.

     

    Thanks,

    Sancho

  • Community Power Platform Member Profile Picture
    on 24 Sep 2020 at 14:26:08
    Re: display selected users profile details

    Hi @iAm_ManCat 

    Thanks,

    Sancho, I have just tried and getting an error, please see attached:

     

    G99_0-1600957557684.png

     

  • Verified answer
    iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on 24 Sep 2020 at 13:59:32
    Re: display selected users profile details

    Hi @Anonymous 

     

    You should be able to use the following code (and then switch around either businessPhone or mobilePhone depending on which one your company uses as a primary field in Active Directory.

     

    If(
     //If business Phone Blank then use Mobile Phone
     IsBlank(
     Concat(
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).businessPhones,
     Value
     )
     ),
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).mobilePhone
     ,
     //Otherwise if businessPhone not blank then use the businessPhone
     Concat(
     Office365Users.UserProfileV2( DataCardValue2.Selected.Email ).businessPhones,
     Value
     )
    )

     

    Could you try that and let me know if that helps? 

     

    Cheers,

    Sancho

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete