Hi @Eickhel, agreed they are 2 different buttons but i meant they have the same formula.
The below does not seam to work because of the topic of this discussion: Referring to a control via a formula? is this possible?
If you look at my PowerApp screenshot, at the left, the side menu used to be buttons, but imagine buttons for +40 screens. I developed the menu eventually via a Gallery, and i was sucessful automate the formula to take me to the right screen via gallry on select.
this is a the on select formula for the menu gallery
If(ThisItem.ecds_screenname="ScreenHome",Navigate(ScreenHome,ScreenTransition.Fade),If(ThisItem.ecds_screenname="ScreenProject",Navigate(ScreenProject,ScreenTransition.Fade),If(ThisItem.ecds_screenname="ScreenProjectDetails",Navigate(ScreenProjectDetails,ScreenTransition.Fade))))
As you see, it is manually done, and this covers 3 screens only. I know I can use excel Concatenate to buld the formula for all screens, but i was thiking use a column in the gallery so my formula would be then super easy:
ScreenHomeOn Visible: Set(CurrentScreen,"Home")
ScreenProject On Visible: Set(CurrentScreen,"Project")
etc.
Menu Gallery OnSelect: Navigate(CurrentScreen, Fade, none)
The issue is that OnSelect is not dealing with the variable CurrentScreen as ScreenName. I used Text(CurrentScreen), same.