I have a powerapps up and running, and it does everything I want. This is connected to an on premise SQL database. One button in this app deletes data from multiple tables that are key linked. In the example below, Table1 has a primary key that is used as a foreign key in Table2, which is what I am filtering on.
The issue I have is that if the user refreshes the page after clicking the button, there is a chance that the first row has finished, but not the second, This leaves the DB with a record in Table 1 that is not linked to a record in Table 2, and we have to go manually into the database in order to delete this record.
I know in SQL Server this can be solved using transactions. Is there a way to solve this using powerapps?
There is nothing built-in to Power Apps that provides transaction support. I would handle this by using a stored procedure called from a Power Automate flow. That will prevent the user from interferring with the deletion until it is complete. You can also use the stored procedure to implement the deletion as a transaction.
Thanks for your help. I definitely considered this, but I was hoping there was an easier way to solve this using powerapps. If not this is what I'll end up doing.
Check out new user group experience and if you are a leader please create your group
Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.