cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AnaGeorgiev
Level: Powered On

How to account for blank fields when retrieving user data? Getting 404 error

I am trying to make an HR hub which shows users some of their information. I am using a user account whose exclusive purpose is building these apps and sending automated notifications and therefore has no job title or manager. However, I am getting a 404 error for the account having no manager yet oddly not for having no title. This is an issue because the owner of the company is also getting this error (being the owner, he of course has no manager).

 

displayed data.PNGWhat I am attempting to display

 

function.PNGThe function which does not work

 

function2.PNGThe function which does work


Accepted Solutions
AnaGeorgiev
Level: Powered On

Re: How to account for blank fields when retrieving user data? Getting 404 error

If(
   IsEmpty(
             Filter(["","President"],
                     Office365Users.MyProfile().JobTitle in ["", "President"])
                      ),
  
"--",
  Office365Users.Manager(Office365Users.MyProfile().Id).GivenName &" " & Office365Users.Manager(Office365Users.MyProfile().Id).Surname)

Got it by referencing this thread:

https://powerusers.microsoft.com/t5/General-Discussion/Office365Users-Manager-throws-error-when-CEO-...


All Replies
AnaGeorgiev
Level: Powered On

Re: How to account for blank fields when retrieving user data? Getting 404 error

If(
   IsEmpty(
             Filter(["","President"],
                     Office365Users.MyProfile().JobTitle in ["", "President"])
                      ),
  
"--",
  Office365Users.Manager(Office365Users.MyProfile().Id).GivenName &" " & Office365Users.Manager(Office365Users.MyProfile().Id).Surname)

Got it by referencing this thread:

https://powerusers.microsoft.com/t5/General-Discussion/Office365Users-Manager-throws-error-when-CEO-...