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
Super User
Super User

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. 

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,165)