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 / ClearCollect function ...
Power Apps
Unanswered

ClearCollect function tags my collection as "Invalid Argument Type"

(0) ShareShare
ReportReport
Posted on by 233

My powerapp broke last week. One of my collections won't collect data from a sharepoint list anymore.

Here is the formula:

ClearCollect(colWellnessLogAvailableOptions, WellnessLogAvailableOptions);
ClearCollect(colWellnessLog, Filter(WellnessLog, Name1 = varUser.FullName));

 

The first collection works, the second, "ClearCollect(colWellnessLog, Filter(WellnessLog, Name1 = varUser.FullName));" will not. 

When I hold my cursor over "colWellnessLog" the error reads:

"The function 'ClearCollect' has some invalid arguments. Invalid argument type."

 

Oddly enough, when I change the collection "colWellnessLog" to something slightly different, (e.g. "colWellnessLogs") it will work. 

Powerapps doesn't seem to like that name. Could it be because it's duplicating a section of another collection's name?

This function has worked for well over a year now and just recently stopped working.

Any ideas?

 

Error 1.PNGError 2.PNG

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @awalker 

    What kind of column is Name1 in your list??  If it is a person column, then change your formula to the following:

    ClearCollect(colWellnessLog, Filter(WellnessLog, Name1.DisplayName = varUser.FullName));

     

    I hope this is helpful for you.

  • awalker Profile Picture
    233 on at

    Name1 is a single line of text column.

    Today the original function

    ClearCollect(colWellnessLogAvailableOptions, WellnessLogAvailableOptions);
    ClearCollect(colWellnessLog, Filter(WellnessLog, Name1 = varUser.FullName));

    works again without errors. But now several other functions have errors that worked when I posted this originally - and I have made no changes to the app.

     

    Now this function and others like it have errors:

    Patch(MileageLog, colMileageLog);

    Error Message:

    "Invalid argument type (Table). Expecting a record value instead."

     

    And:

    "Collect(colWellnessLog, WellnessLog)"

    Error Message:

    "Incompatible type. The collection can't contain values of this type"

     

    I've come across these types of things before - functions displaying errors after working properly for extended periods of time. 

    Would you have any idea why this might be occurring?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @awalker 

    The issue is that when you edit an app, if you make any kind of schema changes along the way, the formula editor will remember those changes as you edit.  In other words, if you have a formula that creates a column in a collection and then you remove that function during the editing, the formula editor still has inferred that the column is there and other functions will not trigger an error.  Once you close and reopen the app, it then re-infers the schemas and once "remembered" columns no longer exist and then formulas have errors.

     

    For your Patch function, that is a misleading error - it is really saying "you have columns in your collection that do not match the schema of the datasource"  When you use a patch like that, the schema of the collection must match exactly the schema of the datasource.

  • awalker Profile Picture
    233 on at

    Ah. Details. How do I fix this problem? And - how do I clear any hold-overs like this in the future? Is there a function?

     

    Greetings

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @awalker 

    Well, for the Patch function, you need to look at everything about your collection...names of columns, types of columns, etc.  They must match identically.  Column names must match the real column names in the datasource. Complex columns must have the exact required schema for their records as well.  Also, any added columns are not allowed.

     

    So, you're kind of showing your starting point (where you collect the data) and the ending point (where you patch the collection to the source), but what happens in between to the collection?  If you are interacting with it in the app, what are you changing?  

    Those are all things to investigate.

  • awalker Profile Picture
    233 on at

    I see. Thank you - this is very helpful

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard