Let's say I have a dropdown control in my PowerApps application named Nav with the next items:
[
"1. Calculator",
"2. Counter",
"3. API",
"4. Collections",
"5. Dropdown",
"6. Acceleration",
"7. Camera"
]
And I want to navigate to a screen by it's name. Something like:
Navigate(Nav.Selected.Value, ScreenTransition.Cover)
Is it possible to do somehow? Or is there a function that returns a control by it's name?
Navigate(GetControl(Nav.Selected.Value), ScreenTransition.Cover)
Because now I have to use If function to navigate in the app like this:
Navigate(If(
"1" in Nav.Selected.Value, Screen1,
"2" in Nav.Selected.Value, Screen2,
"3" in Nav.Selected.Value, Screen3,
"4" in Nav.Selected.Value, Screen4,
"5" in Nav.Selected.Value, Screen5,
"6" in Nav.Selected.Value, Screen6,
"7" in Nav.Selected.Value, Screen7),
ScreenTransition.Cover)
which does not look very nice. Is there more elegant solution?