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

Filter on DataSource

Can we apply filter on datasource so that it can access only data that we request. I am using sharepoint for powerapp. Like we do in sharepoint view, can we do it in powerapp. I want only data fetch from server that I want.

10 REPLIES 10
Steelman70
Level 10

Re: Filter on DataSource

The best current info is here https://powerapps.microsoft.com/en-us/tutorials/function-sort/#delegation

 

However I have not managed to get delegation to work, and I would be grateful if anyone who has managed could please post an example.

TerjeF
Level: Powered On

Re: Filter on DataSource

Nor sure if this is it. But I have some apps where I show a grid (Gallery) based upon a choosen value from a dropbox. The dropbox shows Distincts(Table,Datafield) and the gallery shows the content based upon that selected item.....    Can this do it you think? If so, I can copy some exampels...

Mrunal
Level: Powered On

Re: Filter on DataSource

What you are talking about is applying filter after getting data from datasource. But I want data filtered datasource.

hpkeong
Level 10

Re: Filter on DataSource

Hi

 

Can;t really understand your question.

Are you referring to:

1. Search function?

2. Filtering data and Patch onto another Table and restrict users to view on filtered datasource?

3. Or?

 

Can you please provide example with screenshot and sketch your sample problem for better understanding.

 

Sorry for my poor understanding in English.

TQ

hpkeong
Steelman70
Level 10

Re: Filter on DataSource

Hi hpkeong, I think Mrunal is talking about delegation, but I have not managed to get it to work.
https://powerapps.microsoft.com/en-us/tutorials/function-sort/#delegation

Do you or anyone else know if delegation is actually working?

Anonymous
Not applicable

Re: Filter on DataSource

I would really like this also - being able to design a filtered Datasource would be preferable to filtering the results..

 

I have managed to use the filter function in the gallery to trim the datasource - however I think that this is after the records are returned.

 

I think the question is about editing the Datasource directly to apply an initial filter query.

Power Apps Staff rgruian
Power Apps Staff

Re: Filter on DataSource

Mrunal,

 

"Can we apply filter on datasource so that it can access only data that we request. I am using sharepoint for powerapp. Like we do in sharepoint view, can we do it in powerapp. I want only data fetch from server that I want."

 

Short answer is: it is not possible to configure data sources or explicitly apply server-side queries in PowerApps.

 

That said, when PowerApps detects that your data source is filterable server-side, it will delegate the filter operation to the back end assuming that you are using constructs in your Filter formula that are compatible with what the back end supports. The end result is exactly what you are asking for: the filter will run server side and will return filtered data, instead of running locally on the larger unfiltered data set.

 

What filtering query/criteria are you trying to set in place?

 

Radu Gruian [MSFT] ** PowerApps Staff
Anonymous
Not applicable

Re: Filter on DataSource

For me the issue is I am selecting data from a datasource in a SharePoint list with lost of items. I have connected to the list and then in my Gallery query I am filtering the datasource to only include by a certain criteria

 

SortByColumns(Search(Filter('Departure Points',DeparturePointType = "Cruise"), TextSearchBox1.Text, "DeparturePointCode", "Title"), "Title", If(SortDescending1, Descending, Ascending))

 

This all works well except it does not let me page through all results. I believe that it will only bring so many records out of SharePoint, and as I have two SharePoint Datasources this seems to be halved between the two. I have done a count of each datasource to verify number of records.

 

Saying that when I run my app and page through the gallery items, it is not displaying all data. My total count for in both datasources is 512, therefore I would expect 256 records in each as per count.

 

I only have about 93 items in my filtered results, which seems to tally upto the data being filtered after it is return as the 93 item in the app is the 256 item in the list.

 

Sorry for taking over this thread.. Man Very Happy

 

Andrew

timothydickson
Level: Powered On

Re: Filter on DataSource

Yes, I believe that the function is being delegated to our SQL Server, but I am getting an error:

 

  • "Suggestion: Part of this Filter formula cannot be evaluated remotely due to service limitations.  The local evaluations may produce suboptimal or partial results.  If possible please simplify this formula..."

I have a small table with about 850 records that I want to build my app from.  I have a dropdown control (showing distinct fields) with a display form that needs to show records filtered based upon the selection.  Do I need to import the table locally first, and if so, what is the best method?

 

Also, are there adjustments to our back end server that would need to be enabled so that PowerApps can perform the filter, perhaps?  You mentioned constructs that need to be supported.

 

Please advise. Thanks! Tim

Helpful resources

Announcements
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

Top Solution Authors
Top Kudoed Authors
Users online (6,283)