cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Dual Super User II
Dual Super User II

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!

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

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

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!

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

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,551)