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
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
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
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
)
)
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:
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
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
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2