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

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
Community Support Team
Community Support Team

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

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!

asif082
Level: Powered On

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

Community Support Team
Community Support Team

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

Dual Super User
Dual Super User

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!

asif082
Level: Powered On

Re: PowerApps search and filter sql table

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

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,334)