(Note: this is only my second PowerApp I'm attempting to build and I'm more of a sysadmin/excel data/powershell guy)
I'm trying to get some info out of Office 365 in a dropdown combo box and am unable to get the result I'm looking for.
Relevant info:
- "DisplayName" is in the Search and Display Fields.
- Office365Users_1 can be treated as Office365Users as I'm building the app as "me" but using another account to connect to Office365 and AzAD.
Using the following works (only returns names ending in the mid "G"s however?):
Filter(Office365Users_1.SearchUser({searchTerm:""}),AccountEnabled=true)
"DisplayName" is in the Search and Display Fields
The following does NOT work:
Filter(Office365Users_1.SearchUser({searchTerm:""}),AccountEnabled=true, Not("#EXT#" in Email), (!IsBlankOrError(mobilePhone) && !IsBlank(First(First(Office365Users_1.SearchUser({searchTerm:""})).BusinessPhones).Value)))
If I use:
Filter(Office365Users_1.SearchUser({searchTerm:""}),AccountEnabled=true, Not("#EXT#" in Email), (!IsBlankOrError(mobilePhone))
This appears to filter out only Enabled Accounts and users who have a mobile phone number which is 75% of what I want (with users up to the mid "G"'s again).
Ultimately I want to return DisplayNames of ALL users whom are: internal, active, and have a Mobile OR OfficeNumber populated. I know I can do this by dumping records into our SQL server and reading from there, but would rather not have to manage two separate databases.
-Dave
******************************************* Edit to insert solution that worked for my case *******************************************
Credit to @v-jefferni
Filter(Office365Users_1.SearchUser({top:500}),AccountEnabled=true && Not("#EXT#" in Email) && (!IsBlankOrError(mobilePhone) || !IsEmpty(ThisRecord.BusinessPhones)))