When user is deleted

Hi Bubble Forum,

Just a quick question: I have users, that can enter certain other datatypes - that is, they become linked to what they create as ‘creator’.

When a user is deleted, or deletes himself, does everything they have created become deleted too automatically or do I need to create a flow for that to happen?

If it doesn’t become deleted, what info will be stored as creator?

Thanks

You would need separate workflow steps to delete the datatypes a user has created when the user is deleted. I do this exact thing in all of my apps; when a user is deleted, search for all of the users things in datatype1 and delete them, same thing for all other datatypes, and then delete the user.

As for what happens when a user is deleted and you don’t delete the associated datatypes, I would have to test it to be sure, but I believe the user’s email is still stored as the creator of the datatype.

Hope this helps.

Best…
Mike

2 Likes

According to my tests, the user is completly deleted and the creator or any other column that uses the ‘User’ datatype is simply empty. Thats why it’s important, as @mikeloc has mentioned to delete all data types if they are not important, from your database, if you want to have an efficient database with good performance. If you need the data, for example for comments or a blog, you can delete all user data except for the email and replace it with xxxvariable@xxxxxxvariable.com for example to remove all private user data from the database.

2 Likes

If you don’t mind sharing. Can I see the workflow you use? I’m having a brain fart regarding deleting all the items with the deleted user as a Creator. Thanks in advance!

nvm. facepalm I got it. I’ve been staring at this screen too long lol.

Can you share your workflow for doing this? I’m looking at the same situation where I have multiple data types, and when an entry is deleted from one data type, I need to go through the other data types and delete the rows of data that have a reference to the first data type.

1 Like

Hey Dan, more than happy to help!

It was pretty simple. I have multiple datatypes as well. In my workflow for deleting a user I first use the ‘Delete a List of Things’ function for the respective data types. In the ‘List to Delete’ box I do a search with that data type and set the constraints to Created By = Current User.

1 Like

Thanks, after playing around with that concept I was able to get it to work. Thanks for pointing me in the right direction.

Cheers!

1 Like

Would it work if you simply changed the user’s email to “deleteduser#(lastdeleteduser+1)yourapp@yoururl.com” and removed any personal info (e.g. name / photo / birthday). Would this then still be compliant with their privacy and you can refer to bugs they submitted, etc. etc. You could set a “status” of the user to “deleted” and then only call on info from “active” users in your app…?

This is what I’m thinking of doing so I can keep performance information without infringing on their privacy if they want their data deleted…