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.
Solved! Go to Solution.
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 @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.
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")
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?
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.
@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.
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 BCBuizer, Can 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.