Skip to main content
Community site session details

Community site session details

Session Id : 74RuL2/GHYzBnlIVr/QhSm
Power Apps - Building Power Apps
Answered

Changing Table Filter Returns Blank Values

Like (1) ShareShare
ReportReport
Posted on 10 Jul 2024 20:32:46 by 11

I have a dropdown that I want to change the source of based on a radio selection. Items property of the dropdown is set to the collection SystemNumbers. I have a table with 3 different columns that correspond to the 3 different radio options. When I select the 1st option, it correctly displays the items in the dropdown, but the other 2 radio options display a ton of blank records.

 

Here's what that looks like:

CorrectPowerApp.jpgIncorrectPowerApp.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here is the code I am using currently in the OnSelect function of the radio button:

 

ClearCollect(SystemNumbers, Switch(
 SiteSelector.Selected.Value,
 "AAA",Filter(SystemLookup[@AAA], Len(AAA)>6),
 "BBB",Filter(SystemLookup[@BBB], Len(BBB)>6),
 "CCC",Filter(SystemLookup[@CCC], Len(CCC)>6)
))

 

 

For reference, if I set the items property of the dropdown directly to BBB or CCC like this, it works correctly:

 

Filter(SystemLookup[@BBB], Len(BBB)>6)

 

 

 

For whatever reason the switch statement (I've also tried with IF statements) causes issues. Has anyone seen anything like this or know how to fix it?

  • kochbd Profile Picture
    11 on 11 Jul 2024 at 13:24:26
    Re: Changing Table Filter Returns Blank Values

    This worked! I enclosed it in the ClearCollect statement I had originally, and then once I initialized the collection SystemNumbers with the column name "Value" it started switching the dropdown correctly. Thank you so much for the help!

    Collect(SystemNumbers, {Value: ""});

     

  • SunilPashikanti Profile Picture
    731 Moderator on 10 Jul 2024 at 21:35:07
    Re: Changing Table Filter Returns Blank Values

    Can you give a try like below:

     

    ClearCollect(SystemNumbers,
     Switch(
     SiteSelector.Selected.Value,
     "AAA", Filter(SystemLookup, !IsBlank(AAA)),
     "BBB", Filter(SystemLookup, !IsBlank(BBB)),
     "CCC", Filter(SystemLookup, !IsBlank(CCC))
     )
    )
  • Verified answer
    Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 10 Jul 2024 at 21:26:53
    Re: Changing Table Filter Returns Blank Values

    @kochbd - the column names need to be consistent. Consider using RenameColumns (not delegable):

     

    Switch(
     SiteSelector.Selected.Value,
     "AAA",
     RenameColumns(
     Filter(
     SystemLookup,
     Len(AAA) > 6
     ),
     AAA,
     Value
     ),
     "BBB",
     RenameColumns(
     Filter(
     SystemLookup,
     Len(BBB) > 6
     ),
     BBB,
     Value
     ),
     "BBB",
     RenameColumns(
     Filter(
     SystemLookup,
     Len(CCC) > 6
     ),
     CCC,
     Value
     )
    )

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete