Wednesday, December 22, 2021

Where's my data? Microsoft might have just broken your app

I got a panicked call this morning (Dec-22) from a developer out in the business who suddenly was having severe data loss.  It looked like all of his data was gone.  Worse, it appeared some records still had data, but as he went looking around at it, that data started disappearing!

Ultimately, it wasn't the data disappearing, it was his own app writing blank values over the data because Microsoft had f@#%3d him over by changing something relating to Records vs. Collections.

NOTE: I did just do a test w/ a locally created Collection AND with a SharePoint Collection and everything still works as usual.  So now we're down to testing if this happens with Dataverse (probably), or just Dataverse For Teams.

For those who aren't aware, Microsoft is always doing rolling changes on our environments and the underlying PowerApps infrastructure.  Most times this is beneficial.  Sometimes it blows our crap up.  In this scenario Microsft is trying to deal w/ the concept of a "single item Collection" which they (and the rest of the world) would generally refer to as a Record.


Just a row/record

As a refresher, if we have a single row in Excel, that's just a Row (or a Record).  But if we have a bunch of rows w/ similar data stacked on top of each other, then that's a Table (or a Collection).  It might seem like a small difference, but small differences destroy software applications.


A Table/Collection (poor Orville)

I spent some time b1tching early on around PowerApps not understanding that if there's just a single item in a Collection then it's really a Record so stop making me still use things like First(myCollection).valueIWant and just let me do myCollection.valueIWant.  But I honestly got over it.  

It appears that Microsoft did not.

However, it also appears like they're not really sure what they're doing with it all because: there is no such thing as a variable type that can store a Record in PowerFX/PowerApps currently.  Sure Records exist, but you can't store them anywhere except inside a Collection.  

And this is where it looks like Microsoft did one of two things:

  • Changed the ThisItem property within Galleries to return Records
  • Broke the ability to directly assign Records into Collections
What I mean here is that last week the command below worked perfectly when a user selected an item from a Gallery and loaded all the details about this item into a Collection inside this person's application:

ClearCollect(itemToEdit,ThisItem);

NOTE: This doesn't throw any errors per se nor turn red.  It just doesn't work.

However, suddenly all of this subsequent screens were showing blank values for end-users.  We fixed this by changing the above to:

ClearCollect(itemToEdit,Filter(myDataSource,ID=ThisItem.ID));

Why does this work?  Because the first one (now) returns a Record.  Trying to drop that straight into a Collection was failing.  However, the Filter() command returns a Collection because it doesn't know how many records would be in there.

How bad is this?

I don't know just yet.  This was reported by someone using a Dataverse for Teams connection.  It might be fine for other types of data sources.  I've had my complaints per Dataverse for Teams and honestly, I am not going to use it.  It simply is not reliable in the way I need it to be.  I don't have time in my day to help troubleshoot whatever dumb thing was "fixed" that has now broken everything else.

If this impacts SharePoint Lists and associated Galleries, I'll probably know before the day is over.  However, the plus side here is that I would guess that this is tied to the version of the PowerApps Release version

See the far right column

As a reminder, you aren't forced to the new release until you Publish your app or you've let your app sit out there unmodified for X months.  They eventually force you forward.  So this might not be a problem for you today, but it could be a ticking time bomb.  Meaning, the next time you touch your app...KABOOM!

Final Thoughts

We're opening a ticket w/ MS today but of course w/ the holidays it will be slow.  I also don't know quite how bad this all is yet so am not trying to escalate anything yet.

Personally, this isn't a huge problem for me now that I can fix it, but it could be a very annoying ghost of a problem for everybody else the minute they get pushed to the new PowerApps Release.

No comments:

Post a Comment

Because some d-bag is throwing 'bot posts at my blog I've turned on full Moderation. If your comment doesn't show up immediately then that's why.

DIAF Visualpath team