cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Timm1
Helper III
Helper III

Org chart CEO no manager

Hi there. 

I built a Powerapps Org Chart with Galleries.  I have a galMain and galManager.  When the CEO is selected in the galMain and has no manager, it comes up with an error.  I have researched many different formulas with If(isBlank and If(Error) but I can’t seemed to find something that works with my galleries.   I have a search text that will pull the name to the galMain.  The formula of what I have is listed below.

galMain

Filter(Office365Users.SearchUser({searchTerm:txtEmployeeName.Text}),IsBlank(Department)= false,AccountEnabled=true)

galManager

Office365Users.Manager(galMain.Selected.UserPrincipalName)

 

The formula above works except for the error when we select the CEO.

Thank you.

Tim

1 ACCEPTED SOLUTION

Accepted Solutions
Timm1
Helper III
Helper III

Well, I found a solution that seems to work.  

IfError(Office365Users.Manager(galMain.Selected.UserPrincipalName),[],Office365Users.Manager(galMain.Selected.UserPrincipalName))

 

I got this solution from this youtube video.  https://www.youtube.com/watch?v=Mm4H3m1tNb8

 

Thank you all for your suggestions.  I think my org chart is complete. 

View solution in original post

8 REPLIES 8
v-xiaochen-msft
Community Support
Community Support

Hi @Timm1 ,

 

Did you not turn on Formula-level error management experimental feature?

If so, please try to turn it on. 

I turned on the setting and used the iferror function and no error was reported (the user does not have a manager).

 

vxiaochenmsft_0-1634263408716.png

vxiaochenmsft_1-1634263422933.png

 

Best Regards,

Wearsky

 

Thank you!  I have now turned on the Formula-level setting.  But I still can't find the correct formula to remove the error.  Below is what I currently have.   Maybe an IfBlank ?  

galManager

Office365Users.Manager(galMain.Selected.UserPrincipalName)

 

Thanks!

v-xiaochen-msft
Community Support
Community Support

Hi @Timm1 ,

 

I think you could use IfError() function on a lable control.

IfError(Office365Users.Manager(galMain.Selected.UserPrincipalName),"No manager")

 

Best Regards,

Wearsky

Hi there!  Still giving me an error with adding the formula above.  

StalinPonnusamy
Community Champion
Community Champion

Hi @Timm1 

 

As per my knowledge, there is no way to control this straight.

 

As a workaround, we can try to use JobTitle

 

If(galMain.Selected.JobTitle = "CEO",
    Blank(),
    Office365Users.Manager(galMain.Selected.UserPrincipalName)
)

 

 


Thanks,
Stalin - Learn To Illuminate

Timm1
Helper III
Helper III

Well, I found a solution that seems to work.  

IfError(Office365Users.Manager(galMain.Selected.UserPrincipalName),[],Office365Users.Manager(galMain.Selected.UserPrincipalName))

 

I got this solution from this youtube video.  https://www.youtube.com/watch?v=Mm4H3m1tNb8

 

Thank you all for your suggestions.  I think my org chart is complete. 

View solution in original post

Hi @Timm1 

 

Are you saying, this code works for you?

 

StalinPonnusamy_0-1634585760880.png

 

Yes - No error with this code. 

 

Timm1_0-1634586031931.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,408)