cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Level 8

Count Rows Delegation Warning

I am using the CountRows and getting Delegation Warning. Any suggestions how to get around the Delegation Warning? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Eloy
Level: Powered On

Re: Count Rows Delegation Warning

No need to use CountRows any more, and also your view is incorrect

do these steps instead:

1) Create the correct view

create view vwTotalTickets as 
Select Count(ticket_num) as totalTickets from wynne_tickets

2) Go to your PowerApp and create a new Datasource by going to  View -> DataSources -> Add Datasource  -> Select your SQL Database and then Select your View.

 

3) In your Ticket screen, change the default property for the All Tickets label to the following:

Text(First('[dbo].[vwTotalTickets]'.totalTickets).totalTickets)

This should take care of the problem.

5 REPLIES 5
Community Support Team
Community Support Team

Re: Count Rows Delegation Warning

Hi @thunter ,

 

It is true that CountRows() doesn't support delegation. See in documentation:

Counting functions such as CountRowsCountA, and Count can't be delegated.

Delegation Info

 

It will still return you the number of rows but it will not return more than 500. You can change the number from 500 to 2000. 

 

I would suggest that you could use CountRows() directly on the gallery or collection.

 

Examples:

CountRows(Gallery.AllItems)

OR

CountRows(MyCollection)

 

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.
Eloy
Level: Powered On

Re: Count Rows Delegation Warning

The way I get around that is by creating a SQL View that gives you the count of all the rows in a table. Then all you have to do is to call the view and you will always get correct count of records.

 

Create View As TotalTickets

Select Count(tickteId) as totaltickets from tabletickets

 

Hope this helps!!

thunter
Level 8

Re: Count Rows Delegation Warning

@Eloy  @v-monli-msft 

So I created a View in SQL:

 

But I still get the Delegation Warning

Highlighted
Eloy
Level: Powered On

Re: Count Rows Delegation Warning

No need to use CountRows any more, and also your view is incorrect

do these steps instead:

1) Create the correct view

create view vwTotalTickets as 
Select Count(ticket_num) as totalTickets from wynne_tickets

2) Go to your PowerApp and create a new Datasource by going to  View -> DataSources -> Add Datasource  -> Select your SQL Database and then Select your View.

 

3) In your Ticket screen, change the default property for the All Tickets label to the following:

Text(First('[dbo].[vwTotalTickets]'.totalTickets).totalTickets)

This should take care of the problem.

thunter
Level 8

Re: Count Rows Delegation Warning

Thanks @Eloy that worked!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 52 members 4,508 guests
Please welcome our newest community members: