I have a fairly large dataset (currently under 2,000 units but soon over) so I'm trying to make sure my functions can delegate. I've been over the delegation documentation but I'm not super familiar with the concepts and PowerApps doesn't give a lot of details on what I'm doing wrong. Any assistance would be much appreciated. Here's my formula:
SortByColumns(Filter([@'DSG-Pipeline'], TextSearchBox1.Text in 'New Hire Name'), "StartDate", If(SortDescending1, Descending, Ascending))
DSG-Pipeline is our Sharepoint. The formula points to "in" as the part of the formula that can't be delegated for some reason. 'New Hire Name' is a simple text field. If there's any other info needed let me know. This is being built out for our hiring process and as such needs to be right. Thanks in advance.
The 'in' operator is not a delegable function. That's why you are getting a delegation warning. The delegable alternative is to use StartsWith(). Its not quite the same, but is delegable.
Hmm, thanks @Pstork1 that's frustrating because going over all of MS documentation on delegable functions they didn't mention 'in' a single time.
I'm not quite sure how I can use StartsWith() to replace my functionality, though. If you have a moment and could assist me with that I'd be very appreciative. I don't mind searching every column for data rather than just "New Hire Name" column, and in fact I think that would be better for our solution, but I also wasn't able to get that set up. If I try to just have it Filter the whole Sharepoint list, it throws an incredibly generic error that doesn't help me.
The difference between StartsWith() and 'in' for your application is that in will find the word in the search box anywhere in the name, but StartsWith() will only find it at the beginning. So StartsWith will find 'John' in 'John Smith', but won't find 'Smith'. 'in' would find both. Both search specific columns, but 'in' searches inside the column. You can search multiple columns connected with an 'or', but that's usually overly complex.
Yeah, I understand the difference between how the two operate but didn't see how I could apply it in this context. I see that now but unfortunately that's a nonstarter for us because some users are first, last and others are last, first and that pretty much destroys the functionality of the app if I can't find people's names regardless of the order. I'm not going to try to teach everyone in this process that they have to try the first, then try the last, etc. just to find someone.
PowerApps is really neat but I feel like its functionality is still like a tech demo sometimes. Now I have a choice- never go about 2,000 pieces of data or never be able to competently search the data. I'm not sure where I go from here- this invalidates our entire reason for using PowerApps.
@zmorek Well, first off there's not much I can do there- most of these systems are automated and it's too late to fix anyway.
Secondly, as any developer in the world worth their salt knows, there's no way to standardize names in a meaningful way anyway. If you're going to query names, it has to be a fully query. Seriously, read the link. We have people from all kinds of cultures from across the globe, some without first names, some without last names, some with only single letter first names, etc etc.
I understand the point you're trying to make- standardized data would be great- but standardizing names is impossible anyway, and it doesn't recuse PowerApps from having this absolutely poor feature set.
Your other option is to use something else to pre-filter the data to get it lower than the data row limit (2,000). Then you can use the 'in' operator even though its non-delegable. The issue is that SharePoint doesn't support Contains natively. That's why 'in' isn't delegable. Its a SharePoint limitation not a Power Apps issue.
As I pointed out above. Its not a Power Apps issue. Its a SharePoint limitation. You can't create a delegable function if the backend data source can't do the query.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.