Hi,
I have a canvas app connected to an Azure SQL database with a read/write credentials. And I added an edit form to the app and made the default mode to 'Edit' (also tried 'New'). However, when adding a field to the form, only view controls are available - see the attached image.
It would be great if someone can shed some light into why I cannot add an edit control.
Thanks,
Anton
Solved! Go to Solution.
Did you create an Identity field (Primary Key) in the SQL database when you created it? That's a requirement for posting back to SQL from Power Apps. Without an Identity field the connection will be viewed as Read Only.
Hi Anton - the same thing happened to me after I created a canvas app connected to the Contacts entity from CDS. The primary field "fullname" appears as view only and the options associated with the control are the same as you have shown in your capture1.png. Hopefully it's just a glitch that Microsoft will note and repair shortly.
Hi @GeraldDahl
Thanks for your comment. All of my fields only show view controls. I suspect that it's due to the fact that I don't have a PowerApps Plan 1 or 2. It would be great if someone can confirm.
Thanks,
Anton
Did you create an Identity field (Primary Key) in the SQL database when you created it? That's a requirement for posting back to SQL from Power Apps. Without an Identity field the connection will be viewed as Read Only.
Hi @Pstork1 ,
Thanks for the tip. I can see edit controls in the form now for all other fields except the primary key field. It only shows a 'view text' control. Any thoughts? Thanks in advance.
Cheers,
Anton
Hi @Pstork1
Please ignore my previous comment. It turned out that PowerApps cannot edit GUIDs yet.
Thanks,
Anton
What do you mean by GUIDs? I’m getting a bit concerned because the app where I am experience the same view only issue you described was an app that Powerapps made automatically for me after I selected for it to build everything in connection to the out of the box Contacts entity. I agree with you, Anton, the field that is appearing view only is my primary field and I’m not sure what solution exists based on the discussion in this thread. Perhaps I am misunderstanding what is apparent to others. Thanks to anyone who might be able to guide me further on this.
Hi @GeraldDahl ,
The data type of my primary key was guid/unique identifier. You can learn about guids here if you don't know about them.
As a workaround, I changed the data type of my primary key field to text and now I'm able to edit the field in PowerApps.
Assuming you have the same problem as mine, you might want to create a model-driven app instead of a canvas app.
Hope this helps.
Thanks,
Anton
Its not that its a GUID. Its because its the Primary Key. In general you can't change a Primary Key in SQL whether you are in Power Apps or not. When editing a record the Primary Key is always ReadOnly. For a SQL identity column its also normally auto generated.
User | Count |
---|---|
257 | |
110 | |
97 | |
52 | |
39 |