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 / Search and Toggle comb...
Power Apps
Answered

Search and Toggle combined

(0) ShareShare
ReportReport
Posted on by 38

Dear community, I am new to the world of power platforms. I have the following problem and just can't seem to solve it. I can do both, but not the two combined.

What I am trying to do:

I have a list in SharePoint and I now search it with PowerApps and the following code:

Search('MY LIST';TextBox1.Value;"Title") // This works

But now I want to include a toggle that only shows me values that have a certain value in the "Flow Variable" column. When turned off, it should show all again.

If(Toggle1.Checked;Filter('MY LIST';'Flow Variable' = "VALUE");'MY LIST') // This works also 

But now I want to combine both and I just can't get it to work. How do I combine these two codes?

 

Here is a Screenshot of the App:

screenshot.png
As always I am incredibly grateful for your support

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @FIVESIGN 

    Please consider changing your Formula to the following:

    Search(
     Filter('MY LIST';
     !Toggle1.Checked || (Toggle1.Checked && 'Flow Variable' = "VALUE") 
     );
     TextBox1.Value;
     "Title"
    )

     

    I hope this is helpful for you.

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @FIVESIGN 

    Search() is not a delegatable function for SharePoint lists and if your list exceeds the maximum number of records allowable in Advanced Settings, not all of the records will be returned. Also, ! will cause a delegation error. To ensure that you have a functioning formula that will work on larger lists you may need to modify @RandyHayes 's formula.    If your list exceeds 2000 records, then this formula will work without delegation errors

    With(
     {
     wmylist: If(
     Toggle1.Checked,
     Filter(
     'MY LIST;
     'Flow Variable' = "VALUE"
     );
     'MY LIST'
     };
     Filter(
     wmylist;
     StartsWith(
     Title;
     TextInput2.Text
     )
     )
    ) 
    
    

     

  • FIVESIGN Profile Picture
    38 on at

    Randy you are my hero! Thank you! ❤

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard