1

I have a relatively simple scenario which I am trying to implement in Power Apps, but can't seem to make it work.

I have 2 drop downs which source values will be from a SharePoint list with 2 columns Region and Department. Both these columns are Choice type columns

enter image description here

Department dropdown will depend on Region selected

  1. Region dropdown Items property

    Choices([@MySharePointList].Region)

  2. Department dropdown Items property

    Filter([@MySharePointList], Region.Value = ddlRegion.Selected.Value).Department

I think it filters correctly, however they are Records. As a result, the dropdown has items but are shown as empty items.

How do I retrieve the actual value of the Department for this dropdown?

enter image description here

enter image description here

3
  • Can you confirm if you using dropdown or combobox control for department and region? Is this a standalone canvas app or Power Apps customized list form? Apr 25, 2023 at 7:05
  • Standalone canvas app. Dropdown control for both. Thanks. Apr 25, 2023 at 7:19
  • Check my answer given below Apr 25, 2023 at 7:36

1 Answer 1

0

Use below formula for Department drop down Items property:

Distinct(Filter([@MySharePointList], Region.Value = ddlRegion.Selected.Value), Department.Value)

SharePoint list:

enter image description here

Power Apps output:

enter image description here

6
  • Thanks it works. Funny, it seems that we need to use Distinct outside Filter for this case to work. For example using Filter([@MySharePointList], Region.Value = ddlRegion.Selected.Value).Department.Value does not work. Was wondering if you know why? Apr 25, 2023 at 7:50
  • items property of drop down control expects a table/array input. So, we are creating array of departments using distinct values from Department.Value. Apr 25, 2023 at 7:53
  • Understand, however I think Filter return a table as well? A table of 'Records' in my case (as per screenshot). Hence shouldn't it work with .Department.Value on Filter? Or am I missing something Apr 25, 2023 at 8:04
  • Value property of drop down control works only with simple values such as text, number, dates, etc. While Filter([@MySharePointList], Region.Value = ddlRegion.Selected.Value).Department returns nested/complex objects which are not supported. When you try to use it, you will get warning/error in formula bar. Apr 25, 2023 at 8:20
  • Understood that .Department are complex objects. But was wondering why we can't use .Value directly on Department, example:Filter([@MySharePointList], Region.Value = ddlRegion.Selected.Value).Department.Value. This gives a syntax error. Apr 25, 2023 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.