cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nu-Azu
Frequent Visitor

Need Help with Delegation while filtering a Calendar Gallary

Hello Everyone,

How can i avoid a deligation warning in the logic I used to filter any booked days and disable that day.

 

I really appreciate any help you can provide.

 

DisplayMode Property of Label within my Calader;

If(Countrows(filter('ASK FORM', 'Appointment Date',DateAdd(_firstdayInView,ThisItem.Value))) >0, DisplayMode.Disabled,Edit)

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Nu-Azu 

 

In your case I have a better idea.

 

Why check if CountRows is greater than zero? It's easy to just check instead, for whether or not there is even one Record at all present in the data source of the criteria given (and this should be delegable) - like this:

 

If(!IsBlank(LookUp('ASK FORM', 'Appointment Date',DateAdd(_firstdayInView,ThisItem.Value))), DisplayMode.Disabled,Edit)

 

or perhaps you might prefer to not negate the IsBlank and instead just swap the order you originally gave of the DisplayMode arguments of the If function, and have IsBlank without the negation, like this:

 

If(IsBlank(LookUp('ASK FORM', 'Appointment Date',DateAdd(_firstdayInView,ThisItem.Value))), Edit,Disabled)

 

See if it helps @Nu-Azu  

View solution in original post

3 REPLIES 3

I believe CountRows is likely to be the one that is not a delegable function, I believe it might not be a delegable function on any data source, perhaps except for Dataverse with some caveats.

 

Your options are: 

 

1. Rewrite the formula so it does not use CountRows. In your case, I am not sure how to do this off the top off my head based on the information you provided so far. Perhaps someone else could advise you on this.

 

One thing I might advise you on, is if possible in your case, you can try to avoid the Filter (if possible), and try to use ThisItem instead if you happen to be inside a Form or Gallery control and the data source happens to be already the same one for which you are already operating directly on from the Form or Gallery. This may help in some cases.

 

2. If you are sure (or can make arrangements to be sure) that the argument which CountRows is operating on  (i.e. the Filter you gave), always is expected to return a number that is equal to or less than the data row limit then you can safely just ignore the warning.

 

The data row limit can be found in Settings -> General (scroll down)-> Data row limit. The default data row limit is 500, the max it can be set to is 2000.

poweractivate_1-1666933577314.png

 

See if it helps @Nu-Azu 

@Nu-Azu 

 

In your case I have a better idea.

 

Why check if CountRows is greater than zero? It's easy to just check instead, for whether or not there is even one Record at all present in the data source of the criteria given (and this should be delegable) - like this:

 

If(!IsBlank(LookUp('ASK FORM', 'Appointment Date',DateAdd(_firstdayInView,ThisItem.Value))), DisplayMode.Disabled,Edit)

 

or perhaps you might prefer to not negate the IsBlank and instead just swap the order you originally gave of the DisplayMode arguments of the If function, and have IsBlank without the negation, like this:

 

If(IsBlank(LookUp('ASK FORM', 'Appointment Date',DateAdd(_firstdayInView,ThisItem.Value))), Edit,Disabled)

 

See if it helps @Nu-Azu  

Thank you! this solved the Issue 🙂 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,908)