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 / Collections changing d...
Power Apps
Unanswered

Collections changing data types

(1) ShareShare
ReportReport
Posted on by 212

Hiya

 

Currently the bane of my (PowerApps) life is when one inadvertently changes the data type for a field in a collection. My daughter hits this issue too. Here is the effect... suddenly code that has been happily working changes to "Function Collect() has invalid arguments".

 

Once it happens, it is very hard to narrow down the issue, and the only way to make it go away is to change the name of your collection or the field so it gets regenerated. This is of course painful because one has to then search the application for references to that collection.

 

PA.png

 

In the example above, we worked out that the offending parameter was the one called "Permission" as we modified the code and renamed the parameter to Permission1. I then saved the app to an MSAPP file, renamed it to .ZIP and then extracted ENTITIES.JSON file.

 

Here is the offending section. Note the old problematic Permission column, and the replacement one Permission1. The latter is of type Image (:i) and the former is of type (:e) which I do not recognise. The other columns are self explanatory (eg :n and :s for numeric and string respectively).

 

{"Name":"CatInfo","Schema":"*[Age:s, Breed:s, Colour:s, Description:s, Latitude:n, Longitude:n, MainImage:i, Name:s, Owner:s, Permission:e, Permission1:i, Photos:*[Photo:i], Sex:s]","IsSampleData":false,"IsWritable":true,"Type":"CollectionDataSourceInfo"}

 

So can anybody tell me what is going on here? What data type is E, what could cause a field in a collection to change type and is there an easier way to correct the error?

 

regards

 

Paul

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi paul_culmsee,

     

    What’s your current situation? Are you still having the issue?


    I am trying to reproduce this issue on my side. With the similar code, I don’t get any error message when I make some changes on it.


    You mentioned that you did “inadvertently changes”, what kind of changes did you do on it?

     

    Best regards,
    Mabel Mao

  • paul_culmsee Profile Picture
    212 on at

    Yes, we do have the issue at times and to be honest I am not sure what causes the problem. I think sometimes we might be using functions that affect the data type. Also we sometimes add a collection as a column of an existing collection which seems to trigger it. 

     

    But the main thing, is can you explain the data type of e in the json I quoted from the MSAPP file?

     

    Paul

  • schlaufuchs Profile Picture
    8 on at
    Hi
  • Imi Profile Picture
    2 on at

    Hi,

     

    Old-old thread but maybe you have got tot a fix or workaround.

    In my understanding the data type "e" stands for error. It seems when your app runs to an error when collection data it faces some issues, then nicely store the failed result, as error, in the collection. From then, the data type is messed up.

     

    Did you get to anywhere with this? (double recreation of the collection, raneming etc. works, but fully suboptimal).

     

    Thanks

    Imi

  • luuminhvuong93 Profile Picture
    300 on at

    @v-yamao-msft @paul_culmsee

    I know this thread is old, but I face the same problem apparently.

    Previously, my collection is showing the "Value" column just fine in the Gallery. 

    Until Yesterday. I updated a formula which is the input variable for the "Value" column that allow ".5" to be added into the number.

    (my app is a inventory counting app)

    I don't know why this is happen?

     

    Stock beer milk error.pngSTockMilkBeerList.JPG

  • unknown Profile Picture
    10 on at

    How to set datatype in collection ? Because I am getting error where it says the datatypes are mismatching. 

     

    Any solution would help me .

     

    Thanks in advance.

     

    Help ASAP

     

  • DuyTruong Profile Picture
    2 on at

    Hey, I know this is an old thread and I still could not figure out the root cause but I think I found a way to walk around this. I faced the same issue when trying to add a new item to a collection, using the "Collection"  function. 

     

    Collect(myCollection, {<a new item>})

     

    This seemed to work just fine but if I reloaded the project, it would cause an error.

     

    My walk-around solution is using the "Patch" function. I changed the above to this:

     

    Patch(myCollection,Defaults(myCollection), {<a new item>})

     

    and this solved the issue

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard