For this inventory tracking app I'm working on I have several SQL and SharePoint databases in use. I'm trying to build a "delete this record and all related records from all databases" button to keep things clean, but one of the SQL databases won't work for some reason.
I've tried various methods, Remove, RemoveIf, trying it from Power Automate, but none are working. I hope these pictures convey enough to answer any questions you may have. I can see in both Powerapps and the Monitor, that it doesn't error out. I can't figure out why the Monitor shows that it finds the record, but doesn't go through with deleting it.
I appreciate any help or knowledge I can recieve.
Hi @BakerGroupAlex1 ,
Could you please share more details about your scenario? What do you mean by "all related records from all databases"? Since I have not seen any related records in other tables in your screenshot.
If you would like to delete a single record from data source within a Gallery, you could use Remove function to achieve the need.
On you end, you could apply below formula in OnSelect of the cross icon:
Please refer to the sample in below doc:
You were not able to remove a record with that formula is because TimeStamp is NOT an actual column but a meta data in the table I think, you could use Id value instead.
Then speaking of remove related records in other tables, please share more details about the relationship between those tables.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Remove() should work. Note that RemoveIf does not delegate even in SQL and so should be avoided.
Looks like your LookUp is returning data so I think my next step would be to check whether you can delete the record directly in SQL - possibly it is participating in a relationship and integrity rules are set such that the record cannot be deleted while dependents exist, though it would be nice if PowerApps passed that message through to your App so it was obvious.
Apologies for the late response! It has been one of those kinds of weeks.
What I meant by "all related records from all databases" is just an ID column that shares a value in other databases. There are no dependencies or special rules going on, they're very simple and basic databases. I have tried using:
Remove(TableName, ThisItem). But unlike in the original post, it fails to find the record and throws a 404 error.
To answer the question: yes I am able to directly delete records through SQL, it's how I've been getting by thus far.
Here is what this particular database looks like:
I don't think, "You were not able to remove a record with that formula is because TimeStamp is NOT an actual column but a meta data in the table I think, you could use Id value instead" is applicable here, though I only have a passing knowledge in SQL.
Appreciate the responses!
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.