cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FrancesB
Regular Visitor

Collection Records inaccurate

Using a checkbox to add items to a collection.

then on second screen displaying collection item list, I am getting blank items also in the collection list.

ie. might select 3 items, get a list of 5items with the 3 items and 2 blank items (total item count = 5)

Actioned clear collection records (which works), to reset.

But same thing happens if I try again.

 

Check box is set OnCheck formula Collect(CollectionName, ThisItem)

So there's nothing seemingly wrong there.

Just getting blank data in my collection. Noted the blank lines are "False" in the Pressed column.

1 REPLY 1
EddieE
Super User
Super User

@FrancesB 

It's considered Best Practice to test if the item you are adding to the collection already exists, before adding. Eg

If(  
    IsBlank(LookUp(CollectionName, ID = ThisItem.ID)), 
    Collect(colPreHitchAdd, ThisItem)
)

In this example I've used ID as the record identifier but if that isn't available then you will need to use some other key or a combination of keys.

 

The reason for doing this is because the same record can be added twice, users can inadvertently double-click icons/labels/buttons/etc thereby adding a record twice and good data management.

 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,684)