cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
paul_culmsee
Level 8

Collections changing data types

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

6 REPLIES 6
Community Support Team
Community Support Team

Re: Collections changing data types

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
paul_culmsee
Level 8

Re: Collections changing data types

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
Level: Powered On

Re: Collections changing data types

Hi
Imi
Level: Powered On

Re: Collections changing data types

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
Level: Powered On

Re: Collections changing data types

@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
Level: Powered On

Re: Collections changing data types

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

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 50 members 4,908 guests
Please welcome our newest community members: