cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

CountRows formula slow

Hi all, 

 

I'm relatively new to PowerApps, and I'm wondering how I can reproduce the ticket counter on the "Service Desk" default app.

 

I've connected my app to Salesforce, and I'm pulling back the Cases Table...

 

Here's what I'm trying to do, a count of each job with a field matching a criterion:

 

Capture.PNG

 

Here's the code I'm using to get the  urgent priority count:

 

CountRows(Filter(Cases, OwnerId = "00Ga0000004T8gQ", IsClosed = false, Priority = "Urgent")) + CountRows(Filter(Cases, OwnerId = "00Ga0000004T8gV", IsClosed = false, Priority = "Urgent"))

I'm counting the rows in the First Line that get returned by the filter, and then adding it to the number of rows returned by the filter for the Second Line.

 

When I start the app there's a noticable delay before it loads, external service latency aside, is there any more efficient way I can get a count with the above code?

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff murali
PowerApps Staff

Re: CountRows formula slow

You could simply do

 

CountRows(Filter(Cases, OwnerId = "00Ga0000004T8gQ" || OwnerId = "00Ga0000004T8gV", IsClosed = false, Priority = "Urgent"))

 

2 REPLIES 2
PowerApps Staff murali
PowerApps Staff

Re: CountRows formula slow

You could simply do

 

CountRows(Filter(Cases, OwnerId = "00Ga0000004T8gQ" || OwnerId = "00Ga0000004T8gV", IsClosed = false, Priority = "Urgent"))

 

Anonymous
Not applicable

Re: CountRows formula slow

Thanks @murali!

 

I tried using the Or() operator, but that makes more sense! It's like C# all over again. Smiley Very Happy

 

 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 478 members 5,393 guests
Please welcome our newest community members: