cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mob
Level: Powered On

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
PowerApps Staff rgruian
PowerApps Staff

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

 

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

9 REPLIES 9
hpkeong
Level 10

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

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
mob
Level: Powered On

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

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?

Highlighted
mob
Level: Powered On

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

PS: I need somethign like this

 

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

 

 

but this does not work ...

hpkeong
Level 10

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

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.

 

Screenshot (8).pngGot to define manually....:(...

 

 

Have a nice day.

hpkeong
mob
Level: Powered On

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

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

 

Cannot be done more automatic?

 

PowerApps Staff rgruian
PowerApps Staff

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

 

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

hpkeong
Level 10

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

Hi

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

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

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

 

Thanks in advance. 

 

PytByt
Level 8

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


@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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 193 members 5,419 guests
Please welcome our newest community members: