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

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
Highlighted
Community Support
Community Support

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.

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

Highlighted
New Member

Re: Collections changing data types

Hi
Highlighted
Frequent Visitor

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

Highlighted
Post Patron
Post Patron

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

Highlighted
Regular Visitor

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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,704)