cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Evelyn-Jiang
Frequent Visitor

Dependent Drop Downs do not display.

I have a sharepoint list that is being used to show these 3 fields: Sub-region, Country and City (all the types are Choice), I would like to be able to select the corresponding country in the Country card and then the corresponding city in the City card after selecting Sub-region.

 

I have a series of dependent drop downs, here are the formulas i used:

 

for Sub-region Card Value:

I set the Item function as: Choices([@'List1'].field_Sub_x0020_region)

 

for Country Card Value:

I set the Item function as: Distinct(Filter('List1','Sub-region'.Value=List1EditFormSubRegionValue.Selected.Value),field_Country)

 

But when I tested the Drop Downs, the country value do not display anything but blank, I have checked the color of font, it is blank so it is not the reason.

 

I do not understand what is the issue, can anyone help? thank you.

EvelynJiang_0-1635745898179.png

 

EvelynJiang_2-1635746640584.png 

EvelynJiang_3-1635746722980.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Evelyn-Jiang ,

Assuming List1EditFormSubRegionValue is the name of your drop-down and the filed name is field_Country (not Country as shown), then this should work

Distinct(
   Filter(
      List1,
      'Sub-region'.Value = 
      List1EditFormSubRegionValue.Selected.Value
   ),
   field_Country
).Result

however if you have less than 2,000 items in your list, make all the field Text and do this (I have assumed some field and control names here)

Sub region drop-down

Distinct(
   List1,
   'Sub-region'
).Result

Country drop-down

Distinct(
   Filter(
      List1,
      'Sub-region' = List1EditFormSubRegionValue.Selected.Result
   ),
   field_country
).Result

City drop-down

Distinct(
   Filter(
      List1,
      'Sub-region' = List1EditFormSubRegionValue.Selected.Result &&
      field_country = List1EditFormCountryValue.Selected.Result
   ),
   field_city
).Result

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

9 REPLIES 9
gabibalaban
Dual Super User
Dual Super User

@Evelyn-Jiang ,

Can you please check the DisplayField property of Country ComboBox to be set of ["Result"]. Distinct () function returns a table with one column - Result. 

Hope it helps !

 

WarrenBelz
Super User
Super User

Hi @Evelyn-Jiang ,

Assuming List1EditFormSubRegionValue is the name of your drop-down and the filed name is field_Country (not Country as shown), then this should work

Distinct(
   Filter(
      List1,
      'Sub-region'.Value = 
      List1EditFormSubRegionValue.Selected.Value
   ),
   field_Country
).Result

however if you have less than 2,000 items in your list, make all the field Text and do this (I have assumed some field and control names here)

Sub region drop-down

Distinct(
   List1,
   'Sub-region'
).Result

Country drop-down

Distinct(
   Filter(
      List1,
      'Sub-region' = List1EditFormSubRegionValue.Selected.Result
   ),
   field_country
).Result

City drop-down

Distinct(
   Filter(
      List1,
      'Sub-region' = List1EditFormSubRegionValue.Selected.Result &&
      field_country = List1EditFormCountryValue.Selected.Result
   ),
   field_city
).Result

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

Hi, @gabibalaban ,

 

Thank you for the quick reply. I try to set the DisplayField property of Country as Result, but it returns to Value again after I entered.

@Evelyn-Jiang ,

So, if you have DisplayFields property at least we know that you work with a combobox control, not a dropdown one. 

Can you confirm that in the right menu, Fields ->Edit, you can see in the primary text the Result column and also in the SearchField the same column ?

gabibalaban_1-1635752992167.png

gabibalaban_2-1635753016696.png

 

Hi, @WarrenBelz ,

 

Thank you for the quick share, I tested it according to your formulas, but nothing changes, the selection items are still in blank. It's really weird that there are selection items existed, but these items seem to be invisible.

 

Actually, this is not my first APP, I have designed a similar function in my last APP, and it's distinct(filter()) function still  works fine now. 

 

this issue almost drives me crazy...

Hi, @gabibalaban ,

 

Please refer to the screenshot below: 

 

The Country, Subreigon, and City fields are all Choice data types in my List. When I inserted an edit form, the Control type of these 3 field are only Edit selection, not Allowed values. I checked other 2 fields (SubRegion and City) in the same menu, the Primary Text and Search Field are shown as Value.

 

EvelynJiang_0-1635754140529.png

 

Hi @Evelyn-Jiang ,

Are you referring to my first element or the other suggestion I made ? Looking again if your first drop-down is

Choices(
   [@'List1'].field_Sub_x0020_region
)

then the Items of the second one should be

Distinct(
   Filter(
      List1,
      field_Sub_x0020_region.Value = 
      List1EditFormSubRegionValue.Selected.Value
   ),
   field_Country
).Result

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

hi, @WarrenBelz ,

 

I think this picture can explain the reason why the values are not displayed. I found the only way to solve the issue is to change the data type of Country and City from Choice to Text in my List, then your suggestion will work fine.

 

Anyway, this is the only solution for me now, thank you very much.

 

EvelynJiang_0-1635765400777.png

 

Hi @Evelyn-Jiang ,

If you ran with the Text suggestion please mark this as the solution.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,439)