web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error message in Clear...
Power Apps
Unanswered

Error message in ClearCollect - Incompatible type - The collection can't contain values of this type

(0) ShareShare
ReportReport
Posted on by 380

@WarrenBelz Hi Warren since I resolved my previous post a collection that I am using elsewhere in the app is complaining that it "can't contain values of this type" - is this because I added the ID field to the Gallery - how do I fix this problem please?

 

This is the code I have:

 

ClearCollect(
 collDetails,
 ForAll(
 Sequence(CountRows(Gallery6_4.AllItems)),
 Patch(
 Last(
 FirstN(
 Gallery6_4.AllItems,
 Value
 )
 ),
 {RowNumber: Value}
 )
 )
);

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    Hi @bobgodin ,

    I just ran that code on a gallery here (base on an SP list) and received the expected result (the list with the added RowNo number field). What are the Items of the gallery and where are you running that code ?

  • bobgodin Profile Picture
    380 on at

    Hi @WarrenBelz thanks you for your response. I have solved it - I had added the ID field into the Gallery and this was what the ClearCollect was unhappy about - once I removed it and re-added the original code you gave me with my modifcations it was happy.

     

    what's working now for me:

     Patch(
     TripDetails,
     ForAll(
     Gallery6_4.AllItems As _item,
     With(
     {
     _ID:
     LookUp(
     TripDetails,
     ID = Value(_item.ID)
     ).ID
     },
     {
     ID: _ID,
     tripid: Value(_item.TextInput2_26.Text),
     tripdate: DateValue(_item.DatePicker1_1.SelectedDate),
     destination: _item.TextInput2_25.Text,
     activity: _item.TextInput2_27.Text,
     localcontact: _item.TextInput2_28.Text,
     accomodation: _item.TextInput2_29.Text,
     callintimes: _item.TextInput2_30.Text,
     hoursworked: _item.TextInput2_31.Text
     }
     )
     )
    ));

    thanks again for the help 🙂



     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard