Block user function

Creating a public app with Glide apps. We need a “block” function where users can block each other, so when one user is blocked by another. They won’t be displayed to each other in the app.

I thought of using a relation, but that doesn’t seem to work fully. I’ve done it so that if user (1) now press “Block user” on the profile of the user (2), the email of user (1) will be listed under a column called “Blocked” under user (2) with user (1)'s email.

How would I proceed? Have I done something right.

Assuming that:

  • You’re not using Row Owners, and
  • Each users block list contains a comma separated list of email addresses

Then create a single if-then-else column:

  • If BlockedUsers includes User Profile → Email, then true
  • If User Profile → Blocked Users includes Email, then true

Then use your if-then-else column as a filter.

Thanks, a lot Darren! This made my day by far.

One last question, what would be the best approach to make the button that users click to block this user? Because with using a “add row” it adds a completely new row I just want the users email to be added to the BlockedUsers list when clicked.

The easiest way would be to use a Choice component with multi-select enabled, and target it at the BlockedUsers column in the User Profile. You need to ensure the screen it is on is sitting on top of your Users table, and is filtered by signed in user. The obvious place to have it would be on the same screen where users manage their profile.

If you wanted to do it with a button/action, then it gets more complicated. You’d have to start using some variation of the trebuchet method.

Yes the choice variant you mention works well, but it will display all emails in the table.?

Nevermind I take “display as” name

It will if you don’t filter it :wink:

Thanks again, Darren. Happy new years eve!

1 Like

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