cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
westerdaled
Resolver I
Resolver I

New convention for SQL Table names will break your Power App

 

All

 

Just to give you the heads up , I noticed a new naming change is now in place for Power Apps working with SQL Tables.. Seems only to impact when you remove and re-add a SQL Table.

 

I actually prefer the new convention but there will be some hard work fixing some of the issues either in the  Power App editor or editing the Power App source code .

 

IH Naming issue.png

 

Can be be fixed by reselecting the table name which has now dropped the [dbo]. prefix .

IH Naming issue 2.png

 

Of course this is just the start , you will need to edit all those Errors[dbo.tablenamesnippets etc..my advice is take a deep breath😮.

11 REPLIES 11
timl
Super User III
Super User III

@westerdaled 

Thanks for raising awareness of this issue.

I agree with you that the new naming convention is 'friendlier', but fixing the problems that it causes with existing apps is very hard work.

For an existing app, my inclination would be to rename the data source that we remove and re-add by editing the source code, so that it matches the old naming convention.

As you point out, making this single change is easier than correcting the multitude of changes that may be needed if we were to accept the new data source name, and to rename every instance of the old name to the new name.

@timl 

 

Thanks for your reply.  I am not sure what you meain by renaming the data source ?

 

Do you mean the actual data table e.g. 

dbo.dbo.tablename

 BTW I have had to make mutliple edits today ...Grrrrrrrrrrrrrrrrrr

mogulman
Skilled Sharer
Skilled Sharer

This threw me for a loop last week.  Took a day to figure out.  Had to look at msapp file to figure out.


@mogulman wrote:

This threw me for a loop last week.  Took a day to figure out.  Had to look at msapp file to figure out.


I did the same yesterday when I unpacked  the .msapp file which opened in VSCode. Don't laugh,  for the offending table actually replaced all instances of :

 

Tablename with [dbo].[Tablename]

 

timl
Super User III
Super User III

@westerdaled 

I get your frustration!

What I mean by this is that the table/data source that you we re-added will now be called YourTable.

If you rename this back to [dbo].[YourTable] in the source code, you won't need to modify all the references to YourTable in formula throughout the app.

I'll write this up in a bit more detail and post back here later, as I imagine it'll be helpful to many others....

timl
Super User III
Super User III

@westerdaled - Just to expand on this further, the source code for an app will include references to the table/data source in 3 places.

  • - DataSources\<TableName>.json
  • Connections.json
  • pkgs\<TableName>.json

In each of these files, there will be a reference to 'tablename'. If you change each of these to '[dbo].[tablename]' and repack your app, you can save the hard work of having to rename all existing references to the table when you need to remove and re-add the table.

I've added more details about this process here -

http://powerappsguide.com/blog/post/how-to-rename-data-source

 

 

@timl 

 

Thanks for writing this up . However, I did exactly the same same thing yesterday - essentially a   search and replace. 

 

IH Naming with PSOPA tool.PNG

Open the packed app and went straight to the screen with the errors .  As there were none I emailed my team with the good news..... But this morning when I re-authenticated, loaded up the app in the editor, the errors were back with vengence😵.  This is when I realised  about the new naming convention which seems to impact newly added tables. I have now been able to sucessfully patch against the table .   Now, It may mean I made a mistake so be interested if any others were able to succesfully rename the table references in the source files you meantion.

 

 

 

Quick question , was this change ever published anywhere as would be good to have a weekly report on these types of breaking changes?

timl
Super User III
Super User III

@westerdaled - Thanks for reporting that - it's a bit worrying how errors have appeared for you after re-authentication/and a reload. I renamed views the other week using this technique, which still work.

Unfortunately, I don't think this change was published anywhere. Like many others here, I discovered it only when I added a view and struggled to find it while writing a formula!

@timl 

 

Ok you have kind of set me a challenge 🤔, I will repeat the steps outlined your post for previous version of the app which I will import into our staging evironment. I will let you know if the errors return. 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,995)