Hi there,
I am quite new to PowerApps so my apologies for this rather simple question.
I have 6 dropdowns with the same items in all of them: "Chosen" and "Rejected". All dropdowns are named Dropdown1, Dropdown2 etc.
If I select Chosen in one of the dropdowns, I want the rest of the dropdowns to automatically select "Rejected", vice versa if I change a Rejected dropdown to Chosen, the whole operation starts again.
How would you solve this? I tried to look at default values but without any luck 😞
Thanks in advance,
/Casper
Solved! Go to Solution.
Here you go.
On your app load set a variable like this where 'Dropdowns' is the name of the variable:
Set(
Dropdowns,
{
Dropdown1: false,
Dropdown2: false,
Dropdown3: false,
Dropdown4: false,
Dropdown5: false,
Dropdown6: false
}
)
On each of your dropdowns use this formula changing it as needed based on which dropdown you are setting.
Dropdown1 would be:
If(
Dropdown1.Selected.Value = "Chosen", Set(Dropdowns, {Dropdown1: true, Dropdown2: false, Dropdown3: false, Dropdown4: false, Dropdown5: false, Dropdown: 6 false})
)
Dropdown2 would be:
If(
Dropdown2.Selected.Value = "Chosen", Set(Dropdowns, {Dropdown1: false, Dropdown2: true, Dropdown3: false, Dropdown4: false, Dropdown5: false, Dropdown: 6 false})
)
And so on for each dropdown.
Set the default property for each dropdown:
So the default property for Dropdown1 would be:
If(
Dropdowns.Dropdown1 = false, "Rejected",
Dropdowns.Dropdown1 = true, "Chosen",
Dropdowns.Dropdown1 = false & Dropdowns.Dropdown2 = false & Dropdowns.Dropdown3 = false & Dropdowns.Dropdown4 = false & Dropdowns.Dropdown5 = false & Dropdowns.Dropdown6 = false,
""
)
And the default property for dropdown2 would be:
If(
Dropdowns.Dropdown2 = false, "Rejected",
Dropdowns.Dropdown2 = true, "Chosen",
Dropdowns.Dropdown1 = false & Dropdowns.Dropdown2 = false & Dropdowns.Dropdown3 = false & Dropdowns.Dropdown4 = false & Dropdowns.Dropdown5 = false & Dropdowns.Dropdown6 = false,
""
)
And so on.
My apologies. I give you this elaborate setup and forgot to tell you where to use it! Yes it is used in the OnChange property.
I also see an error I needed to fix in the example for the dropdown2 default formula. It should have read (and I will fix it for others to see):
And the default property for dropdown2 would be:
If(
Dropdowns.Dropdown2 = false, "Rejected",
Dropdowns.Dropdown2 = true, "Chosen",
Dropdowns.Dropdown1 = false & Dropdowns.Dropdown2 = false & Dropdowns.Dropdown3 = false & Dropdowns.Dropdown4 = false & Dropdowns.Dropdown5 = false & Dropdowns.Dropdown6 = false,
""
)
In your default items for each control you will need a formula similar to this: Each control will have 5 statements to evaluate and will reference the other 5 controls.
Here are 2 ways you could do this: This one would be set on Dropdown1 (On dropdown2, you would be referencing dropdowns 1, 3,4,5,6 and so on for each subsequent control)
If( Dropdown2.Selected.Value = "Chosen" Or Dropdown3.Selected.Value = "Chosen" Or Dropdown4.Selected.Value = "Chosen" Or Dropdown5.Selected.Value = "Chosen" Or Dropdown6.Selected.Value = "Chosen", "Rejected", "")
If(
Dropdown2.Selected.Value = "Chosen", "Rejected",
Dropdown3.Selected.Value = "Chosen", "Rejected",
Dropdown4.Selected.Value = "Chosen", "Rejected",
Dropdown5.Selected.Value = "Chosen", "Rejected",
Dropdown6.Selected.Value = "Chosen", "Rejected",
""
)
Thanks for the tip!
I tried to do that, inserted the first If formula in the defaults value of dropdown1 with success. But I get circular reference errors when I try and insert the changed formula on dropdown2 and the other ones. Don't really see how to fix that 😞
I will see if I can figure it out. Other than this are these dropdowns dependent on each other at all? Is the items property for each ["Chosen", "Rejected"] or are they getting the values from a data source?
Here you go.
On your app load set a variable like this where 'Dropdowns' is the name of the variable:
Set(
Dropdowns,
{
Dropdown1: false,
Dropdown2: false,
Dropdown3: false,
Dropdown4: false,
Dropdown5: false,
Dropdown6: false
}
)
On each of your dropdowns use this formula changing it as needed based on which dropdown you are setting.
Dropdown1 would be:
If(
Dropdown1.Selected.Value = "Chosen", Set(Dropdowns, {Dropdown1: true, Dropdown2: false, Dropdown3: false, Dropdown4: false, Dropdown5: false, Dropdown: 6 false})
)
Dropdown2 would be:
If(
Dropdown2.Selected.Value = "Chosen", Set(Dropdowns, {Dropdown1: false, Dropdown2: true, Dropdown3: false, Dropdown4: false, Dropdown5: false, Dropdown: 6 false})
)
And so on for each dropdown.
Set the default property for each dropdown:
So the default property for Dropdown1 would be:
If(
Dropdowns.Dropdown1 = false, "Rejected",
Dropdowns.Dropdown1 = true, "Chosen",
Dropdowns.Dropdown1 = false & Dropdowns.Dropdown2 = false & Dropdowns.Dropdown3 = false & Dropdowns.Dropdown4 = false & Dropdowns.Dropdown5 = false & Dropdowns.Dropdown6 = false,
""
)
And the default property for dropdown2 would be:
If(
Dropdowns.Dropdown2 = false, "Rejected",
Dropdowns.Dropdown2 = true, "Chosen",
Dropdowns.Dropdown1 = false & Dropdowns.Dropdown2 = false & Dropdowns.Dropdown3 = false & Dropdowns.Dropdown4 = false & Dropdowns.Dropdown5 = false & Dropdowns.Dropdown6 = false,
""
)
And so on.
Thank you for this! Working with a global variable makes sense!
I have one question that I do not fully understand; you wrote that: "On each of your dropdowns use this formula changing it as needed based on which dropdown you are setting".
Where exactly do I change this formula? OnSelect, OnChange or? It cannot be the default property, since this is another formula 🙂
My apologies. I give you this elaborate setup and forgot to tell you where to use it! Yes it is used in the OnChange property.
I also see an error I needed to fix in the example for the dropdown2 default formula. It should have read (and I will fix it for others to see):
And the default property for dropdown2 would be:
If(
Dropdowns.Dropdown2 = false, "Rejected",
Dropdowns.Dropdown2 = true, "Chosen",
Dropdowns.Dropdown1 = false & Dropdowns.Dropdown2 = false & Dropdowns.Dropdown3 = false & Dropdowns.Dropdown4 = false & Dropdowns.Dropdown5 = false & Dropdowns.Dropdown6 = false,
""
)
Thank you very much!
I think this solved it - even though I have some 'errors', it at least now works every time I select "chosen".
Excellent suggestion and help!
If you don't mind me asking, what 'errors' are you seeing?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
193 | |
70 | |
49 | |
48 | |
20 |
User | Count |
---|---|
249 | |
127 | |
84 | |
76 | |
74 |