Study FAQ
How do I read and update Dataverse rows from a Power Apps code app?
Also asked as 2
- How can I generate and use a Dataverse table service in a Power Apps code app?
- What should I check when adding Dataverse CRUD to a code app?
Answer
In an initialized code app, add a Dataverse table by logical name, inspect the generated TypeScript service, and use its contracts for create, get, list, update and delete. Verify the operation result and the affected record under the intended user's identity.
For a synthetic Account test in an enabled Dataverse development environment, run pa app add data-source --connector dataverse --table account from the project root. Import the generated Accounts service from a handwritten module. When data-source definitions change, regenerate and review the service contract. Keep application orchestration in your handwritten code. Use getAll with selected fields, a defined order and a bounded page or result size. Use update with the selected row ID and the changed fields, then get to confirm the saved value. Inspect each generated result for errors. For supported paging, use the options in the service contract. The documented connector wrapper lists direct FetchXML and alternate-key access as unsupported.
Omit system-managed fields on create. For delete, confirm the selected disposable row, handle cancellation and verify that the specific row disappears after a successful operation. Preserve the unsaved edit on a failed save and show unavailable data separately from a successful empty list. Test read and write with allowed and restricted users.
Full explanation
AB-400: Building Code Apps with Dataverse and Automation
Study guide · AB-400
Read the full explanation