web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing Table Filter ...
Power Apps
Answered

Changing Table Filter Returns Blank Values

(1) ShareShare
ReportReport
Posted on 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?

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @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
     )
    )

     

     

     

  • Sunil Kumar Pashikanti Profile Picture
    2,308 Moderator on at

    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))
     )
    )
  • kochbd Profile Picture
    11 on at

    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: ""});

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard