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

CountRows and CountIf return wrong values when concurrent use

I have a very small table. It's a sharepoint list, not reaching the limit.

Tested the app on two screens (concurrent users) at the same time.

I'm using CountRows to obtain the number of records and the CountIf to test the presence of certain records in the table.

Both functions return the wrong results after extending or decreasing the number of records in the table. I don't get the correct figures back.

It seems that CountRows an CountIf cache their values and update them in their own instance of the app.

Does anyone experience the ame, and is there a solution?

2 ACCEPTED SOLUTIONS

Accepted Solutions
RonHappel
Level 8

Re: CountRows and CountIf return wrong values when concurrent use

This problem by solved by implementing the same solution as my Gallery problem.

Please read: https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Gallery-values-are-wrong-when-concu...

View solution in original post

Super User
Super User

Re: CountRows and CountIf return wrong values when concurrent use

Hi @RonHappel 

I would try refreshing your data source before you call the CountRows/CountIf function. That should hopefully solve this cache issue, and return more accurate results. You could refresh the data source through the OnVisible property of your screen, or perhaps on a timer.

Refresh(YourSharePointList)

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-refresh 

View solution in original post

3 REPLIES 3
RonHappel
Level 8

Re: CountRows and CountIf return wrong values when concurrent use

I tried the Sum(ForAll ...) solution as described in

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/CountIf-Displaying-Wrong-Number/m-p...

but the (wrong) result is the same.

RonHappel
Level 8

Re: CountRows and CountIf return wrong values when concurrent use

This problem by solved by implementing the same solution as my Gallery problem.

Please read: https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Gallery-values-are-wrong-when-concu...

View solution in original post

Super User
Super User

Re: CountRows and CountIf return wrong values when concurrent use

Hi @RonHappel 

I would try refreshing your data source before you call the CountRows/CountIf function. That should hopefully solve this cache issue, and return more accurate results. You could refresh the data source through the OnVisible property of your screen, or perhaps on a timer.

Refresh(YourSharePointList)

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-refresh 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,543)