Hi I would like to cascade my dropdowns using conditions. Previously, I was able to do it with switch function. On my drpCountry dropdown, when I select a country, drpAvailable will show "No" automatically. Now, I added all the list of countries on my SharePoint list. All countries availability (drpAvailable) except for US is automatically (DefaultSelectedItems) set to No. When I select US in drpCountry, I should still be able to modify the drpAvailable to Yes or No.
Below is the code I've used before using the switch function
Switch(
drpCountry.Selected.Value,
"GB",
{Value: "No"},
"AU",
{Value: "No"},
"CA",
{Value: "No"},
"SA",
{Value: "No"},
"UAE",
{Value: "No"}
)
Solved! Go to Solution.
Hi @biancadevera :
Could you please tell me:
What do these two sentences mean?
All countries availability (drpAvailable) except for US is automatically (DefaultSelectedItems) set to No. When I select US in drpCountry, I should still be able to modify the drpAvailable to Yes or No.
If you want the default option of this combo box to be "No" when the user selects "US", then the formula can be written like this:
Switch(
drpCountry.Selected.Value,
"GB",
{Value: "No"},
"AU",
{Value: "No"},
"CA",
{Value: "No"},
"SA",
{Value: "No"},
"UAE",
{Value: "No"},
{Value: "No"}
)
If you want the default option of this combo box to be "No" only when the user selects "US", and the formula is "Yes" when the user selects other values, the formula can be written like this:
Switch(
drpCountry.Selected.Value,
"US",
{Value: "No"},
{Value: "Yes"}
)
Best Regards,
Bof
Hi @biancadevera :
Could you please tell me:
What do these two sentences mean?
All countries availability (drpAvailable) except for US is automatically (DefaultSelectedItems) set to No. When I select US in drpCountry, I should still be able to modify the drpAvailable to Yes or No.
If you want the default option of this combo box to be "No" when the user selects "US", then the formula can be written like this:
Switch(
drpCountry.Selected.Value,
"GB",
{Value: "No"},
"AU",
{Value: "No"},
"CA",
{Value: "No"},
"SA",
{Value: "No"},
"UAE",
{Value: "No"},
{Value: "No"}
)
If you want the default option of this combo box to be "No" only when the user selects "US", and the formula is "Yes" when the user selects other values, the formula can be written like this:
Switch(
drpCountry.Selected.Value,
"US",
{Value: "No"},
{Value: "Yes"}
)
Best Regards,
Bof
Hi @v-bofeng-msft ,
I was able to improve the logic of my formula. Thanks for enlightening me. So here's what I did:
I pull the data from my SharePoint list to the drpCountry. Then I used this formula as suggested:
Switch(
drpCountry.Selected.Result,
"United States",
{Value: "Yes"},
{Value: "No"}
)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
203 | |
45 | |
45 | |
45 | |
39 |
User | Count |
---|---|
279 | |
81 | |
79 | |
79 | |
69 |