cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

PowerApps search and filter sql table

Hello everyone,

 

I have a problem with sql table and Power Apps gallery. I have SQL table with more than 5000 record but I only need to show data in powerapps gallery with filter which would probably will be only 100 records max but it only filter first 2000 record and display record which falls under 2000, so any idea how can I filter record which is more than 2000 and only show record filter record which only 100 or less.

below is the formula I am using so please any one can share any tips or any workaround.

 

Search(
Filter(
'[dbo].[Family_Violence_Listing]',
Listing_location = ddlViewCourtLocation.Selected.LocationID
&& DateValue(Text(Listing_Date),"en-US") = DateValue(Text(CalViewNTDate),"en-US")
),
TextSearchBox.Text,
"Case_Number",
"Party_Name"
)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: PowerApps search and filter sql table

Hi @asif082 ,

 

This is because that the date filter cannot be delegated when we use SQL as the data source. Please have a look at the workaround in below blog:

https://medium.com/@dmitrii.korolev1/filtering-sql-table-by-date-in-powerapps-4711dc79696a

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Dual Super User III
Dual Super User III

Re: PowerApps search and filter sql table

Hey @asif082 

 

This is happening because of delegation, can you share a screenshot of the expression in the editor where it is showing blue line under the delegated part of expression.

Also, can you try the below expression if this helps:

Search(
Filter(
Filter('[dbo].[Family_Violence_Listing]',
Listing_location = ddlViewCourtLocation.Selected.LocationID), DateValue(Text(Listing_Date),"en-US") = DateValue(Text(CalViewNTDate),"en-US")
),
TextSearchBox.Text,
"Case_Number",
"Party_Name"
)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: PowerApps search and filter sql table

Thank @yashag2255  for replying, I have tried to apple double filter as per your text below and still didn't work, I have remove the date filter and it brings all the record but with date sill =< 2000. 

 

below is the screen shot. 

thank you.


screen shot.PNG

Highlighted
Community Support
Community Support

Re: PowerApps search and filter sql table

Hi @asif082 ,

 

This is because that the date filter cannot be delegated when we use SQL as the data source. Please have a look at the workaround in below blog:

https://medium.com/@dmitrii.korolev1/filtering-sql-table-by-date-in-powerapps-4711dc79696a

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: PowerApps search and filter sql table

Hi @asif082 

 

Delegation works a bit different with the date records, can you try to do the workaround for setting up a variable to avoid delegation? This could be done on "OnVisible" property of the screen.

Quoted from the article:
Example #1 – The following filter throws a delegation warning:

Filter(Jobs, ‘Tentative Job Start Date’ <= DateAdd(Today(),7, Days) )

Issue: DateAdd is not a constant value. The filter depends on the value of this expression, but the expression is not delegable to the data source (not in the list of supported operations). As a result, the entire filter operation cannot be delegated.

Solution: Evaluate the DateAdd expression separately and store the value in a variable (DateLimit) to be used in the Filter function. DateLimit is a constant value at the time of filtering. The filter no longer throws a delegation warning.

Set(DateLimit, DateAdd(Today(),7, Days));

Filter(Jobs, ‘Tentative Job Start Date’ <= DateLimit )

Reference: https://www.powerobjects.com/blog/2019/03/04/delegation-warnings-powerapps/ 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: PowerApps search and filter sql table

Thanks @yashag2255  and @v-monli-msft for you reply, really appreciate guys. 

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,188)