# Redirect user deleted by admin

**URL:** <https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292>\
**Category:** Get Help\
**Created:** [December 26, 2021, 5:34pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292 "2021-12-26T17:34:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Webea](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@Webea](https://forum.adalo.com/u/Webea)\
**Post date:** [December 26, 2021, 5:34pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/1 "2021-12-26T17:34:24Z")

</div>

Hi all.

When deleting a user from the database, said user can continue moving through the application without account, name, email, etc …

I have a function in the app to delete the account, and it works correctly. When the user is deleted, the user is automatically redirected to the welcome screen for a new registration or login. But deleting it from the database does not redirect. I have tried adding the action on the screen of “when seeing this screen … Link to welcome screen / Sometimes / Only if Loggedinuser is equals to Loggedinuser email”. The problem is that the current user is no longer logged in, that’s why it doesn’t work …

Any idea how this can be solved?

Thank you all!

---

<div class="post-metadata">

**Author:** ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)\
**Post date:** [December 26, 2021, 6:15pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/2 "2021-12-26T18:15:35Z")

</div>

Hi,

After spending some time here in the forum, I noticed that many experts advise not to delete records from the database to avoid these kinds of behaviors.

What I suggest you do instead is to add an “update logged in user” action to the delete button, and add a custom formula like rand(1,999) in the email field of the user to remove the user’s email from the database. Also, you can add a logout action and “deleted” true/false to the button.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Webea](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@Webea](https://forum.adalo.com/u/Webea)\
**Post date:** [December 26, 2021, 7:07pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/3 "2021-12-26T19:07:01Z")

</div>

> [@m-mrh](#):
>
> After spending some time here in the forum, I noticed that many experts advise not to delete records from the database to avoid these kinds of behaviors.
> 
> What I suggest you do instead is to add an “update logged in user” action to the delete button, and add a custom formula like rand(1,999) in the email field of the user to remove the user’s email from the database. Also, you can add a logout action and “deleted” true/false to the button.
> 
> Hope this helps!

Thank you very much for the quick answer!

So there is no way I can remove or lock a user from the database being the administrator? This is to have the possibility of being able to eliminate or block a user for inappropriate use, for example, and not be left by the application in ghost mode. It has not happened to me but I have observed that before this possibility, just in case, somehow there must be …

I will continue investigating possibilities.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![m-mrh](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@m-mrh](https://forum.adalo.com/u/m-mrh)\
**Post date:** [December 26, 2021, 7:21pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/4 "2021-12-26T19:21:12Z")

</div>

You’re welcome @Webea

Oh okay sorry, I didn’t know you wanted to delete users yourself as admin. I just tried it myself and after reloading the page the user was signed out automatically.

---

<div class="post-metadata">

**Author:** ![Eugen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/eugen/32/25382_2.png) [@Eugen](https://forum.adalo.com/u/Eugen)\
**Post date:** [December 26, 2021, 8:02pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/5 "2021-12-26T20:02:26Z")

</div>

You can try a procedure like this :  
Action **on Home Screen** - Link to Signup if **Logged in User - Email - is equal to - emtpy**.  
I think should works and you can avoid the user app navigation once he delete his account

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [December 26, 2021, 9:01pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/6 "2021-12-26T21:01:04Z")

</div>

To make answers more colorful, we can also use true/false method mentioned above to be forced logout, so whenever user interact with screens they are checked for this field.

I made tutorial about forced logout, just search that term.

---

<div class="post-metadata">

**Author:** ![Webea](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@Webea](https://forum.adalo.com/u/Webea)\
**Post date:** [December 27, 2021, 1:10pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/7 "2021-12-27T13:10:38Z")

</div>

Thank you very much for the reply!

Unfortunately I already tried it and it didn’t work for me …

---

<div class="post-metadata">

**Author:** ![Webea](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@Webea](https://forum.adalo.com/u/Webea)\
**Post date:** [December 27, 2021, 1:13pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/8 "2021-12-27T13:13:47Z")

</div>

Perfect that was my solution… As easy as creating a true / false feature called “admin ban” in users and voila. The user is restricted and is redirected to the welcome screen.

Thanks so much for the help! it was solved!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [January 6, 2022, 1:14pm UTC](https://forum.adalo.com/t/redirect-user-deleted-by-admin/21292/9 "2022-01-06T13:14:36Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
