Does Powerapps support nesting Search and Filter?
Currenty only a single fuinction works, as soon as there are 2 or more they do not work.
Is this intended or will this change in the future?
Search and Filter can be nested inside each other, it should work. Depending on your data source, you may get a warning that Search does not support delegation (as is the case with SharePoint), but functionally it should work.
If this is not the case for you, can you please provide more details (expression used, data source, detailed error message)?
Thanks for the fast reply,
Since you state it should work let me write down what i'm dealing with.
Both of the function work on their own and return results (500 only, but still ok)
City = "New York" || City= "Los Angeles"
Let's say I want to search people in New York or Los Angeles.
If i try to nest them the Filter one does not work, just the Search
City = "New York" || City = "Los Angeles" ),
I'm connecting to Common Data Services, and it's listed that is should support both function.
Have you tried the Startswith function?
Filter(CDS1, City="New York"|| City ="Los Angeles",
@Drrickryp, The Search works as expected. but the filter() does not eliminate other results from the table.
So Search gives results with all cities included, ignoring the filter condition.
@v-micsh-msft, i'm pulling data from Common Data Service and i need to work with delegable functions as this is a 500+ data set.
Only Sharepoint datasources support Startswith.
But when i need is 3 Funtions nested, after Search and FIlter i need to get only the Last 500 record and not the first 500 as is pulled by default.
I tested it on one of my CDS data sources with > 2000 items and found the same thing that you did. I'm not sure why Search() and Filter() don't play well together. However, in the following example I used the "in" function and since it is not delegatable, I created a collection called ds and filtered that.* I added a Dropdown box loaded with city names (Distinct,ds,City), set the Items property of my DataTable to Filter(ds,TextInput1.Text in Name && City =Dropdown1.Selected.Result). It worked perfectly. If you want to work with the last 500 records in your datasource, I suggest creating a collection like ClearCollect(ds,FirstN(Sort(YourDataSource,ID,Descending),500)).
If you want to use multiple selections for City, use a ListBox set with the Select Multiple Items property set to true. Set the Items property of the DataTable to Filter(ds,TextInput1.Text in Name && City in ListBox1.SelectedItems.Result)
* Functions like in, not, etc are not subject to delegation limits in collections.
I need to delegate in order to get complete and therefore accurate results.
What is the point of having only 500 from a larger set? to see latest changes? to get a "feel" for the data from the 500 sample pool? Made the design and UI easier if you only work with a handfull of records?
None of this helps me, i can't tell clients hope your record was in the 1st 500 rows.
Anyway, noone makes a app if it will have a dozen records, they use pen and paper...
As i see it now this is just a new version of Infopath for tablets and phones. Great for inputing a single data record, while all other data overview or pulling is not there yet (Functional and well documented).
Did i misunderstand anything about Powerapps here?
I believe that you have underestimated what Powerapps is capable of accomplishing. First, you can increase the default item limit from 500 to 2000 in File - AppSettings. Second, I have constructed apps that include as many as 90,000 items in a table and they work almost instantly on my phone or tablet. The key to creating complex apps from large data sources is understanding Delegation. Delegation refers to whether a given powerapps function is applied to a local data set or is occurring over a network. Some functions are delegatable meaning that they operate at the network level and others (non delegatable) will only work on the data brought to the device. For example, Filter and Sort are two functions that work at the network level for almost every type of data source. This means that they can work in seconds on hugh data sources. To quote from: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview
"The key to building efficient apps is to minimize the amount of data that must be brought to your device. Perhaps you need only a handful of records from a sea of million, or a single aggregate value can represent thousands of records. Or perhaps only the first set of records can be retrieved, and the rest brought in as the user gestures that they want more. Being focused can dramatically reduce the processing power, memory, and network bandwidth that your app needs, resulting in snappier response times for your users, even on phones connected via a cellular network. Delegation is where the expressiveness of PowerApps formulas meets the need to minimize data moving over the network. In short, PowerApps will delegate the processing of data to the data source, rather than moving the data to the app for processing locally."
To build more than the simplest app from a single Excel table it is important to understand where the functions operate on data. While I have only had minimal experience with InfoPath, I migrated a complex Access Web App that ran a doctor's office with >12,000 patients and 50,000 visits to Sharepoint lists and the Powerapps Common Data Service, created a Powerapps front end and it works great. There are many (> 150) backend databases that work with Powerapps including Sql, Salesforce and Common Data Service to name a few. I wouldn't give up on it until you have tried to get past the basics.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.