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

Notifications

Announcements

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
    153,073 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard