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 News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,998)