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 Data Source w...
Power Apps
Answered

Changing Data Source with Switch/If Function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I am attempting to apply the filter function to a gallery with a data source dependent on the dropdown value selected. The current formula I am using

 

Filter(Switch(Dropdown.Selected.Value, "A", TableA, "B", TableB), Searchbox.Text in Title)

 

produces the error "Expected Record Value". The Switch function operates properly but the search function does not. Please advise. 

 

Thank you!

 

 

Categories:
  • Verified answer
    Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    I've seen this when trying to use an IF statement inside a Filter() function. You'll need to put the Switch statement on the outside and then duplicate the hard coded Filter statements for each Switch 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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard