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 / Filter by user and sea...
Power Apps
Answered

Filter by user and search results with searchbox

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

   I'm running into errors when trying to add a search box to my filtered data. Can anyone see where I am messing up in my formula? My current formula in the browse gallery is pasted below and works without an issue.  I get errors when I go to add the search function.  The dataset is a SharePoint list.  

 

Filter('Actuals (WRFP-1)',Or('GWA ID L/U:Account Manager_TXT' .Value=CurrentUser, 'GWA ID L/U:Sales Manager_TXT' .Value=CurrentUser))

 

I tried adding the search function with the below formula but I'm getting errors.  

 

Search(Filter('Actuals (WRFP-1)',Or('GWA ID L/U:Account Manager_TXT' .Value=CurrentUser, 'GWA ID L/U:Sales Manager_TXT' .Value=CurrentUser)), 'Search Box'.Text,'GWA ID L/U:BillingID_Name_DataCard1')

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Please consider changing your Formula to the following:

    With({_items:
     Filter('Actuals (WRFP-1)',
     'GWA ID L/U:Account Manager_TXT'.Value=CurrentUser ||
     'GWA ID L/U:Sales Manager_TXT'.Value=CurrentUser)
     )
     },
    
     Search(
     AddColumns(_items,
     "_billID", 'GWA ID L/U:BillingID_Name_DataCard1'.Value
     ), 
     'Search Box'.Text, _billID
     )
    )

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  The filter function is throwing the below errors.  Did I not input it correctly?  I was able to get the formula to work with the following changes.  Do you see any issues with the new code?

     

    With({_items:
    Filter('Actuals (WRFP-1)',Or(
    'GWA ID L/U:Account Manager_TXT'.Value=CurrentUser,
    'GWA ID L/U:Sales Manager_TXT'.Value=CurrentUser)
    )
    },

    Search(
    AddColumns(_items, "_billID", 'GWA ID L/U:BillingID_Name'.Value
    ), 'Search Box'.Text, "_billID"))

     

    Nate167_0-1639758297031.png

    Nate167_1-1639758319170.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    The only difference is that you are using the long-hand version of OR whereas mine was using the short-hand version.

    And the problem was that I had an additional closing paren.

    Should have been:

    With({_items:
     Filter('Actuals (WRFP-1)',
     'GWA ID L/U:Account Manager_TXT'.Value=CurrentUser ||
     'GWA ID L/U:Sales Manager_TXT'.Value=CurrentUser
     )
     },
    
     Search(
     AddColumns(_items,
     "_billID", 'GWA ID L/U:BillingID_Name_DataCard1'.Value
     ), 
     'Search Box'.Text, _billID
     )
    )

    Either will work.

    Sorry for the typo...extra parens are free!! 🤣

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  lmao no worries about the typo.  I checked them and counted myself and didn't catch it.  One final question.  Once the user selects the account they want it takes them to the next screen where I have BrowseGallery1.Selected as my formula.  This page is now blank and the selected is throwing an error with the new formula on the previous screen.  Do you know what is needed to resolve this? 

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

    @Anonymous 

    Yes, we added a column in the process of your search.  If you have schema dependencies in other places, then it will cause some issues.

    The need is to just drop the column.

    Here is that formula:

    With({_items:
     Filter('Actuals (WRFP-1)',
     'GWA ID L/U:Account Manager_TXT'.Value=CurrentUser ||
     'GWA ID L/U:Sales Manager_TXT'.Value=CurrentUser
     )
     },
     DropColumns(
     Search(
     AddColumns(_items,
     "_billID", 'GWA ID L/U:BillingID_Name_DataCard1'.Value
     ), 
     'Search Box'.Text, _billID
     ),
     "_billID"
     )
    )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  Thank you for all of your help!!  I'm migrating an InfoPath form and working through the learning curve.  

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Very good!  Just keep in mind that InfoPath is more "development" like.  PowerApps is a no-code, Excel-like platform.  Once that is embraced, it is pretty simple. 😁

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  Does the SP experience matter for Powerapps?  All of our lists are in classic vs new.   Also is there a trick to getting the information to write back to SP?  I searched and read responses and have tried some of the responses with no luck.  I did see a response you gave about 4 or 5 things that could be it and I tried them all except deleting and creating a new form.  

     

    I have onselect set to Submitform(Form1) and in the Item of form one I have '2022 Forecast Gallery'.Selected

    I do not have any required fields in this list that would be causing the issue.  

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Fairly good working knowledge of SharePoint is a real plus if you are going to work with that data source (in fact knowledge about any datasource you work with would be highly beneficial.)

     

    You appear on the right track...you should have a form.  Its Datasource should be set to your list.  The Item property will be the record you are trying to work with.

    In your case, the '2022 Forecast Gallery' should have its items based on the same datasource as your Form.

     

    Then, SubmitForm(formx) is all you need to submit it.

     

    If you create a form and modify only those above properties, then it should work without any issue.  If there are modifications done, then that is where issues can creep in.

     

    Explain more about the problem you are experiencing and what you have done up to that point.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  Thank you, my item field was blank and that was the problem. Your message triggered me to look at it and make sure it was set up properly.    Thank you again for all the help you've provided.  I'm proficient in SP and have been working in it for 3 years.  This site that I started managing about a year ago was set up in classic due to workflows being utilized prior to that function being discontinued.  I have set up other informational sites in the new look but have been hesitant to migrate this one over.  This site I currently manage has a lengthy list of permissions so that each sales team can only see their customers and not others.  This is why I needed the filter formula in place in the app.  

     

    If you don't mind I have one final question.  Those fields I have my filter set up for are lookup fields in SP.  I get a delegation error but since my list is sub 2K records it seems to be running ok.  On initial startup of the app there is about a 20 second load time for accounts to populate.   Would this load time be sped up if I were to create text columns for the filter to reference instead of lookups?

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard