cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Draax
Level: Powered On

ClearCollect on gallery, only first 5 items are correct

Hi,

 

 

I have a gallery on my mainscreen with 100 diffrent items.

Inside the gallery i have a textbox with the following code: 

Value(CountRows(Filter(Lager, 'Title (Title0)'.Value=ThisItem.Title,Reserverad.Value = "Nej", Sparad.Value <> "Ja")))

(Checks how many items is there in stock per item)

 

Next screen I have a datatable where I collect an inventory report.

 

OnSelect for getting the data for the datatable are:

ClearCollect(Report, AddColumns(Gallery_Main_Artiklar.AllItems, "Antal", Label_Current_Stock.Text))

The first 5 items in the report (textbox) are correct.

The next 95 items will get the same value as item 5.

 

Workaround, scroll through the items gallery all the way to the end and the report will be correct.

 

Is there a way to permanently fix this without the given workaround?

 

Thanks - Johan

 

1 ACCEPTED SOLUTION

Accepted Solutions
Draax
Level: Powered On

Re: ClearCollect on gallery, only first 5 items are correct

I woundn't mind at all. However it seems like i found some sort of workaround.

 

If i press the button again to clearcollect, it will get the correct values.

To build the work around i put a timer, clearcollect on start - delay 4 sec - clearcollect on finish.

Report now show correct values.

 

Thanks for you help Smiley Happy

 

Draax

4 REPLIES 4
Highlighted
hnguy71
Level 8

Re: ClearCollect on gallery, only first 5 items are correct

Hi @Draax ,
If i'm understanding this correctly, you want the count of items that matches your Title. Instead of the countrows function you should instead do a countif inside your label:

CountIf(Lager, Title = ThisItem.Title && Reserverad = "Nej" && Sparad <> "Ja")

datatable.png

 

 

Draax
Level: Powered On

Re: ClearCollect on gallery, only first 5 items are correct

Hi @hnguy71 ,

 

Thanks for your reply!

 

Unfortunately i'm experiencing the same issue with the new code. Im attatching images to clarify.

 

This is the report

flux.png

 

 

 

This is my gallery with diffrent items for sale

flux2.png

 

If I scroll all the way to the bottom of the gallery the report will be correct.

I think it has to do with PowerApps only executing the textbox once it has been viewed.

 

Draax

hnguy71
Level 8

Re: ClearCollect on gallery, only first 5 items are correct

Hi @Draax 

Do you mind sharing me your sample data? I would like to see if I can reproduce your issue

Draax
Level: Powered On

Re: ClearCollect on gallery, only first 5 items are correct

I woundn't mind at all. However it seems like i found some sort of workaround.

 

If i press the button again to clearcollect, it will get the correct values.

To build the work around i put a timer, clearcollect on start - delay 4 sec - clearcollect on finish.

Report now show correct values.

 

Thanks for you help Smiley Happy

 

Draax

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

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!

Users Online
Currently online: 47 members 4,170 guests
Please welcome our newest community members: