cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
strategery
Resolver II
Resolver II

Did they break Edit Forms?

Just got newest version of Studio(desktop version). I don't remember having this much trouble creating an edit list...hopefully I'm missing something easy...

(datasource = SQL database)

I initially made my own form via submit button + several text input boxes and attempted to use a 'Patch' to insert a new row. The documentation read that the first argument is a data source, but Studio is giving me an error saying the first argument must be a collection, that that idea died.

 

So I attempted a form. 'Insert > Forms > Edit' inserts a form that shows it is in 'Edit' mode. I choose my datasource, check the boxes for each field (it only has 4). No matter what I do it will NOT let me edit a field. I changed the Default mode to 'New'. I tried navigating to the screen using NewForm(formname);Navigate(screen,fade).

 

After a while I realized when I checked the box for each field to create data cards, the automatically created data cards had two labels in them, not a label and a text input box. Is that correct?  I deleted the 'value' label and inserted my own text input box, set everything up, then when I go to SubmitForm I actually get an error that I must include 'item'. Lost so much time with this

1 ACCEPTED SOLUTION

Accepted Solutions

Figured it out!  (Edit: For clarification, I initially tried to create records using patch, then couldn't make an edit form work either; found solution for 'patch' issue. It also corrected the issues I was having with the 'Edit' form)

 

Data source MUST have a primary key or it will not recognize it as a collection. A few days ago I had dropped the primary key in my table because I realized we needed multiple entries for the same part number, but I was in a rush and didn't re-create the table with new primary key. I can duplicate the error by dropping primary key in my new table and refreshing it in PowerApps.

View solution in original post

9 REPLIES 9
Meneghino
Community Champion
Community Champion

Hi @strategery

Not sure why you had problems with Patch, it has worked consistently well with me for over a year now always with Azure SQL Database.  I gave up on oob forms a while back.

https://baizini-it.com/blog/index.php/2017/09/28/powerapps-101-create-your-own-forms/

 

@Meneghino

Thank God I thought I was crazy. I know I have used Patch with SQL before. Now it doesn't work, it must be the update. I need to go back to my other computer and see if it has the same problem with the older version. I feel like they really broke some things here.

@strategery

just worked with this today (v 2.0.760) and all is ok.

I would strongly recomend only ever editing apps in the latest version of studio, otherwise they may not be published and work as intended.  It doesn't help that there is no longer any direct way of knowing what the current version is, the indirect way is to open the web editor and look in the 'account' section.

Please tell me you see something wrong here...

image.png

Unfortunately I don't see anything wrong...

As I said, all works for me, you should raise a ticket with MS here, they usually respond in a few hours.

_.JPG

 

 

PS There is an opportunity to improve performance by substituting the Defaults() function with a null record...

https://baizini-it.com/blog/index.php/2018/01/11/powerapps-replace-the-defaults-function-to-improve-...

Well, shoot. I've had strange issues with the desktop version. I actually upgraded my laptop from Win7 to Win10 so I could get the latest and greatest. Thanks for the tips!

Figured it out!  (Edit: For clarification, I initially tried to create records using patch, then couldn't make an edit form work either; found solution for 'patch' issue. It also corrected the issues I was having with the 'Edit' form)

 

Data source MUST have a primary key or it will not recognize it as a collection. A few days ago I had dropped the primary key in my table because I realized we needed multiple entries for the same part number, but I was in a rush and didn't re-create the table with new primary key. I can duplicate the error by dropping primary key in my new table and refreshing it in PowerApps.

View solution in original post

@strategery You're my hero! Where do I send the fan mail?

 

I'm a total noob with PowerApps (and SQL) and it was taking forever to find out why:

  • The "create app from my data" function of PowerApps would not generate an app that had edit/new record functions built in;
  • After manually building these forms the SubmitForm() and Patch() functions both returned errors when I tried to add/edti records.

BUT after adding a PRIMARY KEY in my SQL Server Database Table, everything works fine!  Now I can focus on what matters for our company (usability for the users who really don't care about my SQL headaches, just if the app works).

 

Thanks!

 

P.S. I've read a lot of posts throughout my search so no doubt have been making other incremental improvements to silly errors I'd made, but the Primary Key one really did fix everything.

Hi @JackPegler

Please have a look here for more issues to keep in mind in relation to SQL Server:

https://baizini-it.com/blog/index.php/2017/09/28/powerapps-and-azure-sql-database-current-issues/

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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (69,038)