cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Changing Data Source with Switch/If Function

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
Pstork1
Dual Super User
Dual Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,677)