cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PowerAppsJunkie
Level: Powered On

How to filter or Search SQL Search results from a gallery?

Hi new to PowerApps and trying to learn as I go.

 

I have an application where I am doing a search on a SQL Table to return records based on who is logged in and that part works.  Now I want to either do another search based on those returned results or filter of those results based on what someone is searching on in a text box.

I've tried filter when using on prem-SQL and the results take forever so I went with search statement instead and it's much much quicker.  Is there something wrong in my filter statement? or is filter that much slower than search?

Here is the formula I'm using on Items to display in a gallery.

 

Filter Function: (Very Slow) but it returns data based on OwnerName who is logged in

Filter('[dbo].[Test]',Lower(OwnerName) = Lower(Office365Users.MyProfile().DisplayName))

 

Search Function to display same data (Much Faster)

Search('[dbo].[Test]',Office365Users.MyProfile().DisplayName,"OwnerName")

I get results back in the gallery but now I want to add a search box that will search / filter the first results returned.

So the search is first on Owner Name but that might return 400 rows and to limit that further I want a search box that a user could type information in that would further filter this data down so it's more usable.

This is all tied back to a SQL on-premise backend.

Any suggestions or help would be greatly appreciated.


1 REPLY 1
Administrator
Administrator

Re: How to filter or Search SQL Search results from a gallery?

Hi @PowerAppsJunkie - our Community Support Team helped a user with a similar question. I will include the link to the post and the answer from CST below. Please review when you have time and advise if this is what you're looking for. 

 

Link to the thread - https://powerusers.microsoft.com/t5/General-Discussion/How-to-do-a-search-bar/td-p/184905

 

CST response:

 

For your first question, do you want to create a search bar within your app? More details about create a search bar within PowerApps app, please check and see if the following video would help in your scenario:

https://www.youtube.com/watch?v=FaTnOOc34os

In addition, I think the "List Screen" (Screen template) could also achieve your needs. The "List Screen" (screen template) as below:4.JPG

When you add a "List screen" within your app, it would generate a screen which contains a Search bar box and a gallery automatically as below:5.JPG

 

For your second question, do you want to send an reply email within your app? If you want to send an email within your app, I think the Office365.SendEmail() function could achieve your needs. Before using Office365.SendEmail() function, you need to add a Office 365 Outlook connection within your app.

More details about the Office365.SendEmail() function, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-outloo...

Please also check and see if the following video would help in your scenario:

https://www.youtube.com/watch?v=bF7WkqtxKB0

So on your side, you should add the Office365.SendEmail() function within the OnSelectproperty of the "Submit" button as below:

SubmitForm(EditForm1); /* <-- Submit your internal Note*/
Office365.SendEmail(
    "user@email.com",
    "Subject of the email",
    "Body of the email"
)

@TopShelf-MSFT 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 290 members 5,633 guests
Please welcome our newest community members: