cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mob
Advocate II
Advocate II

Navigate to screen selecting element from the list (through list name)

navigateOnScreenThroughList.png

I have one list, and I created different screen with the same name like element of the list.

I get a list form the Rest call (and this rest call returns me a list containing this elements  [addition, multi ...] )

 
What I want is, when I select the element from the list, to navigate to the specific screen for this element.

 

I thought that is something like this: Navigate( ThisItem.workbookName , ScreenTransition.Fade) but I get the code error.

Can someone give me a hint how to solve this?

I also tried via UpdateContext, and to create a variable, but without success.

 

1 ACCEPTED SOLUTION

Accepted Solutions

 

If you are using a dropdown or listbox control for the screen selection, please do the following:

 

    Dropdown1.Items = [Screen1, Screen2, Screen3]

    Dropdown1.OnChange = Navigate(Dropdown1.Selected.Value, Fade)

 

If you absolutely must use a gallery, you need to keep the mapping between screens and screen names yourself somewhere. This can be encoded either in logic (formulas) using the If() function, or in data, using a table/collection. Here's how to do the latter:

 

    xyz.OnSelect = Navigate(Lookup(Screens, Name = Gallery1.Selected.workbookName, Target), Fade)

    Screen1.OnVisible = ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 }, . . .  )

 

I hope this helps.

 

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

10 REPLIES 10
hpkeong
Community Champion
Community Champion

Hi

 

For each:

- TextBox or

- TextInput

   You can always have OnSelect. Navigate(ScreenName, Transition).

 

Since you are going to the screen with the SAME NAME as your WorkBookName, I would suggest that you name the screen that you wish to, with the same name as the WorkBookName.

 

Hope it helps.

(I remember there are some other threads, couple of months ago, talked about this by Sara. Please search if you can).

 

 

hpkeong

Hi, but the thing is that this is a gallery with filled elements (list)....

I tried everything and does not work...
I cannot hardcode this with  Navigate(ScreenName, Transition), because Then for some other list I need to change this again... I need somethign like Navigate ( ThisItemSelected.workbookName , transition ) or with some variable. 

 

How can this be achieved?

PS: I need somethign like this

 

Navigate( Gallery1.Selected.workbookName , ScreenTransition.Fade)

 

 

but this does not work ...

hpkeong
Community Champion
Community Champion

Hi

 

I wish my simulation here can help you.

I am sure some others will have better approach compare to mine.

My idea is logic but guess, too, simple and too manually written.

Anyway hope you like it.

 

Got to define manually....:(...Got to define manually....:(...

 

 

Have a nice day.

hpkeong

Thanks, but I was searching something to avoid writing the hardcoded thing   e.g. "if soomething ="malesia" " or so.

 

Cannot be done more automatic?

 

 

If you are using a dropdown or listbox control for the screen selection, please do the following:

 

    Dropdown1.Items = [Screen1, Screen2, Screen3]

    Dropdown1.OnChange = Navigate(Dropdown1.Selected.Value, Fade)

 

If you absolutely must use a gallery, you need to keep the mapping between screens and screen names yourself somewhere. This can be encoded either in logic (formulas) using the If() function, or in data, using a table/collection. Here's how to do the latter:

 

    xyz.OnSelect = Navigate(Lookup(Screens, Name = Gallery1.Selected.workbookName, Target), Fade)

    Screen1.OnVisible = ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 }, . . .  )

 

I hope this helps.

 

 

Radu Gruian [MSFT] ** PowerApps Staff
hpkeong
Community Champion
Community Champion

Hi

That's a much more better ideas and options.
I wish this will meet the requester's needs.
hpkeong

This does not seem to work for me on the 2017 version. Can you please help?  

 

Thanks in advance. 

 


@rgruian wrote:

 

If you are using a dropdown or listbox control for the screen selection, please do the following:

 

    Dropdown1.Items = [Screen1, Screen2, Screen3]

    Dropdown1.OnChange = Navigate(Dropdown1.Selected.Value, Fade)

 

If you absolutely must use a gallery, you need to keep the mapping between screens and screen names yourself somewhere. This can be encoded either in logic (formulas) using the If() function, or in data, using a table/collection. Here's how to do the latter:

 

    xyz.OnSelect = Navigate(Lookup(Screens, Name = Gallery1.Selected.workbookName, Target), Fade)

    Screen1.OnVisible = ClearCollect(Screens, { Name: "Screen1", Target: Screen1 }, { Name: "Screen2", Target: Screen2 }, { Name: "Screen3", Target: Screen3 }, . . .  )

 

I hope this helps.

 

 


Hi @rgruian 

can you show the formula above with exact sample? cuz, i dont really understand. 

Also, can we do it without using any collection? how?

 

i want to navigate my screen as well with gallery.

 

thanks.

pytbyt

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,463)