cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zerou
Helper III
Helper III

Launching specific pages for each item from dropdown box selection

Hello,

 

I am yet again befuddled by something and need some assistance please. I simply wish to be able to navigate to certain URL's based on the selection made in a drop down box. I did some reading and it seems that I can use the Launch function to do this. But from what I've seen, it's unclear to me how I can add it to my drop down box. 

 

In the advanced tab for the combo box, I have:

 

["Apples","Juice", "Garlic","Green","Red","Summer","Autumn","Winter"]

 

So I tried doing this:

Launch(Apples.https://apples.com), Launch(Juice. https://Juice.com) 

But that didn't work. My limited programming knowledge says this doesn't make any sense, and that there should be an IF statement at the beginning, no? For example: //IF Apples, launch "https://apples.com"//, and so on, correct? Because I have a list of things that I want to lead to different pages upon selection. 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
rohitsbots
Resolver II
Resolver II

@zerou 

 

Try this on the OnChange event of your dropdown.

 

If(ComboBox1.Selected.Value = "Apples",Launch("https://apples.com"),ComboBox1.Selected.Value = "Oranges",Launch("https://oranges.com"))

 

Tip: Make sure to use a dropdown instead of combobox if you have to select only 1 option.

View solution in original post

BCBuizer
Super User
Super User

Hi @zerou ,

 

A third option is to include a URL in the Items property of the combobox:

 

 

[{Value: "Apples", URL: "https://apples.com"},
{Value: "Juice",  URL: "https://juice.com"},
{Value: "Garlic", URL: "https://garlic.com"},
{Value: "Green", URL: "https://green.com"},
{Value: "Red", URL: "https://red.com"},
{Value: "Summer", URL: "https://summer.com"},
{Value: "Autumn", URL: "https://autumn.com"},
{Value: "Winter"] URL: "https://winter.com"}]

 

 

Like that you can use 

 

Launch(ComboBox.Selected.URL)

 

 

Big advantage is that you only have to update your data in one place if the values were to ever change.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

12 REPLIES 12
BCBuizer
Super User
Super User

Hi @zerou ,

 

Using the below formula shows how this may work: 

 

Launch("https://" & "microsoft" & ".com") 

 

So if you replace "microsoft" with ComboBox.Selected.Value, it should do what you want:

 

Launch("https://" & ComboBox.Selected.Value & ".com") 


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
rohitsbots
Resolver II
Resolver II

@zerou 

 

Try this on the OnChange event of your dropdown.

 

If(ComboBox1.Selected.Value = "Apples",Launch("https://apples.com"),ComboBox1.Selected.Value = "Oranges",Launch("https://oranges.com"))

 

Tip: Make sure to use a dropdown instead of combobox if you have to select only 1 option.

Hi, yes it's a dropdown box not a combo, would that make a difference in the snippet you posted above?

BCBuizer
Super User
Super User

Hi @zerou ,

 

A third option is to include a URL in the Items property of the combobox:

 

 

[{Value: "Apples", URL: "https://apples.com"},
{Value: "Juice",  URL: "https://juice.com"},
{Value: "Garlic", URL: "https://garlic.com"},
{Value: "Green", URL: "https://green.com"},
{Value: "Red", URL: "https://red.com"},
{Value: "Summer", URL: "https://summer.com"},
{Value: "Autumn", URL: "https://autumn.com"},
{Value: "Winter"] URL: "https://winter.com"}]

 

 

Like that you can use 

 

Launch(ComboBox.Selected.URL)

 

 

Big advantage is that you only have to update your data in one place if the values were to ever change.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

@zerou It won't. You can use the same code on the OnChange event of your combobox.

Okay, thanks. I tried using it as such to test:

The drop down box ID where I'm working in is Dropdown7:

If(Dropdown7.Selected.Value = "Apples",Launch("https:Apples.com"))

 

I then hit play, but nothing happened when I selected Apples. 

@zerou Did you put this code on the OnChange property of the dropdown ?

 

rohitsbots_0-1660601493276.png

 

Hi, yes I did. I'm still getting used to all this and made a stupid oversight. The text for values is case sensitive and I put "apples" instead of "Apples", as soon as I changed that, it worked. Thanks a million! 🙂

Hi  BCBuizerCan you explain this method a little bit more please? Like just dumb it down a lot? Would I first define my values in the box as:

["Apples", "Juice","etc""] and then add 

 

[{Value: "Apples", URL: "https://apples.com"},
{Value: "Juice",  URL: "https://juice.com"},
{Value: "Garlic", URL: "https://garlic.com"},
{Value: "Green", URL: "https://green.com"},
{Value: "Red", URL: "https://red.com"},
{Value: "Summer", URL: "https://summer.com"},
{Value: "Autumn", URL: "https://autumn.com"},
{Value: "Winter"] URL: "https://winter.com"}]

 

After it in the box? Because this does seem a bit cleaner and would make it easier for future changes for myself and others.

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.

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 (5,373)