Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Answered

Canvas App with Navigation template

Like (1) ShareShare
ReportReport
Posted on 12 Sep 2024 21:43:06 by 380
 
Hi,
 
I have created a Left Navigation menu template and added across all screens and it's working as expected.
 
Here is my navigation component Table
 
Table(
 
{MenuLabel: "Home",
 
MenuIcon: Icon.Home,
 
MenuScreenNavigate: App.ActiveScreen,
 
MenuID: 1,

},
 
{MenuLabel: "Events Screen",
 
MenuIcon: Icon.CalendarBlank,
 
MenuScreenNavigate: App.ActiveScreen,
 
MenuID: 2,
 
},

{MenuLabel: "Members",
 
MenuIcon: Icon.People,
 
MenuScreenNavigate: App.ActiveScreen,
 
MenuID: 3,

})
 
Added the following code on App Start property.
 
Set(leftMenuforAdmin, Table(
 
{MenuLabel: "Home",
 
MenuIcon: Icon.Home,
 
MenuScreenNavigate: scrHome,
 
MenuID: 1

},
 
{MenuLabel: "Events",
 
MenuIcon: Icon.CalendarBlank,
 
MenuScreenNavigate: scrAllEvents,
 
MenuID: 2
 
},
 
{MenuLabel: "Members",
 
MenuIcon: Icon.People,
 
MenuScreenNavigate: scrManageMembers,
 
MenuID: 3
 
});
 
Added navigation component to all screens and it's working as expected. Now I would like to new links to the navigation table but I want to use Launch() function instead of App.Activescreen.
 
First 3 links should use App.Activescreen and the new links should use Launch() to open external links in a new window.
 
I added one more column with Launch() function couldn't expected results. Can anyone provide me ideas to achieve this functionality.
 
Any help would be greatly appreciated.
 
  • OK29 Profile Picture
    OK29 380 on 13 Sep 2024 at 03:26:25
    Canvas App with Navigation template
    @FLMike, Thank you Mike for your comments.  I was able to resolve this by adding two columns as mentioned in the code which was almost similar to your answer.
  • Verified answer
    OK29 Profile Picture
    OK29 380 on 13 Sep 2024 at 03:19:38
    Canvas App with Navigation template
    At last I was able resolve this.
     
    Added two more properties as below 
     
     
     
    Table(
     
    {MenuLabel: "Home",
     
    MenuIcon: Icon.Home,
     
    MenuScreenNavigate: App.ActiveScreen,
     
    MenuLaunch: LaunchTarget.New,
     
    MenuType:"Screen",
     
    MenuID: 1
     
    },
     
    {MenuLabel: "Events Screen",
     
    MenuIcon: Icon.CalendarBlank,
     
    MenuScreenNavigate: App.ActiveScreen,
     
    MenuLaunch: LaunchTarget.New,
     
    MenuType:"Screen", 
     
    MenuID: 2
     
    },
     
    {MenuLabel: "Members",
     
    MenuIcon: Icon.People,
     
    MenuScreenNavigate: App.ActiveScreen,
     
    MenuLaunch: LaunchTarget.New,
     
    MenuType:"Link",
     
    MenuID: 3,
     
    });
     
    Added the following code for OnSelect Property of the gallery of the component.
     
    If(ThisItem.MenuType="Link", Launch(ThisItem.MenuLaunch),Navigate(ThisItem.MenuScreenNavigate))
     
    Added the following code on App Start property.
     
    Table(
     
    {MenuLabel: "Home",
     
    MenuIcon: Icon.Home,
     
    MenuScreenNavigate: scrHome,
     
    //MenuLaunch: "", //No need to add 
     
    MenuType:"Screen",
     
    MenuID: 1
     
    },
     
    {MenuLabel: "Events",
     
    MenuIcon: Icon.CalendarBlank,
     
    MenuScreenNavigate: scrAllEvents,
     
    //MenuLaunch: "", //No need to add
     
    MenuType:"Screen",
     
    MenuID: 2
     
    },
     
    {MenuLabel: "Members",
     
    MenuIcon: Icon.People,
     
    //MenuScreenNavigate:,  //no need to this for link
     
    MenuLaunch: "Google.com",
     
    MenuType:"Link",
     
    MenuID: 3
     
    });
  • Suggested answer
    FLMike Profile Picture
    FLMike 27,286 on 13 Sep 2024 at 03:10:27
    Canvas App with Navigation template
    Hi,
     
    I am not sure what you mean by you added a column for Launch
     
    I think, what you have is pretty good.
     
    What you could do, is add an extra column called External and make it a boolean.
     
    Put true or false
     
    Then when they click, Check if its External and if so use Launch and MenuScreenNavigate would actually be the URL
    But if its false then its just a Navigate
     
    If this helps please mark as the answer
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,696

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,456

Leaderboard
Loading complete