web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamically set commands
Power Apps
Answered

Dynamically set commands

(0) ShareShare
ReportReport
Posted on by 3

Hi, I'm new to powerApps and I'm trying to make a simple practice app to get more familiar with it. I've dynamically created tabs of sort using a gallery however I'm trying to make each tab/button either change to a different screen or make other elements such as buttons visible?  Any direction on how I might get this done would be brilliant. 

 

This is what I've currently got and I've been trying to implement a command of sorts within this but I am having no luck

ClearCollect(
colTabs,
{
ID: 1,
Name: "Users",
Logo: Icon.AddUser,
command: "Navigate(Screen1, ScreenTransition.Fade)"
},
{
ID: 2,
Name: "Workpace",
Logo: Icon.AddLibrary,
command: "test"
},
{
ID: 3,
Name: "Spare",
Logo: Icon.ComputerDesktop,
command: "test"
},
{
ID: 4,
Name: "Spare",
Logo: Icon.CameraAperture,
command: "test"
}
);

 

Miwisluck_0-1639078384949.png

 

Cheers

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,530 Most Valuable Professional on at

    Hi @Miwisluck ,

    You cannot refer to Elements like icons or commands dynamically, however you could us the name with hard-coding.

    In the image control for instance

    Switch(
     ThisItem.Name,
     "Users",
     AddUser,
     "Workpace",
     AddLibrary,
     "Spare",
     ComputerDesktop,
     "Spare",
     CameraAperture,
    )

    and on the OnSelect

    Switch(
     ThisItem.Name,
     Navigate(Screen1, ScreenTransition.Fade),
     "Workpace",
     . . . . 
     . . . .
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard