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

Remove left menu item from Leave Management app?

Hi, so I'm using the Leave Management template and I'm wanting to remove the 'About' and 'My Leave Balance' menu items from the left menu, however I'm not too sure how to do it since the items are a part of a 'collection'.

 

I have already disabled navigation to those pages, but the items are obviously still visible. I tried the Remove ThisItem option which kind of worked, but when I load the app up again it just seems to populate the menu again.

 

What is the proper way to do this, without actually deleting the screen itself (incase I want to utilise it later)?

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff jovan
PowerApps Staff

Re: Remove left menu item from Leave Management app?

As you have found, the left menu is populated based on the LeftMenuCollect collection.  The collection is built up in the LoginScreen.  OnSelect actions of LoginAsManagerGroup and LoginAsEmployeeGroup contain lines like:

 

ClearCollect(LeftMenuCollect, "My Leave Requests", "Company Holidays", "About");

Does dropping About from these lines solve the problem?

4 REPLIES 4
SaxonRix
Level: Powered On

Re: Remove left menu item from Leave Management app?

I have also just tried setting the following into OnStart also, but still no luck:

 

ClearCollect(
    LeftMenuCollect, 
    Table(
            {
                value:"My Leave Requests", 
            }
           	,
            {
                value:"My Leave Balance", 
            }
                ,
            {
                value:"Company Holidays", 
            }
        )
    );
SaxonRix
Level: Powered On

Re: Remove left menu item from Leave Management app?

Ok, so I have now set up a table in excel instead of using the collection, making it easier to delete/add menu items. However, this has broken the styling & I'm struggling to correct it.

 

The original code in the one of the style boxes (when the menu's data source was a collection) was:

If(LeftMenuSelect = ThisItem.Value, RGBA(47,41,43,1), RGBA(12,132,255,1))

I've tried modifying this to the following, but it's not working:

If(LeftMenuList = ThisItem.Title, RGBA(47,41,43,1), RGBA(12,132,255,1))

'LeftMenuList' is the name of the table in the data source.

 

I thought this would be correct, but it's just showing up black. Could someone point me in the right direction?

PowerApps Staff jovan
PowerApps Staff

Re: Remove left menu item from Leave Management app?

As you have found, the left menu is populated based on the LeftMenuCollect collection.  The collection is built up in the LoginScreen.  OnSelect actions of LoginAsManagerGroup and LoginAsEmployeeGroup contain lines like:

 

ClearCollect(LeftMenuCollect, "My Leave Requests", "Company Holidays", "About");

Does dropping About from these lines solve the problem?

Boneckrh19
Level 8

Re: Remove left menu item from Leave Management app?

In the OnStart of the LoginScreen, just find the code that creates the collection, (it recreates it on startup each time) and change the items however you want. 

 

If you do want to continue to use an excel table, you just need to change ThisItem.Value to ThisItem.WhateverYourFieldIsCalledInExcel

 

Then you just need to correct any issues you now have in the OnSelect of the that menu gallery.