Hide/show rows in a single collection based on user type

I’m building a checklist of tasks that bereaved families have to deal with after losing a loved one. Where I’m from, these tasks can be very different depending on the deceased person’s religion so during onboarding, we ask our users to specify if they’re Muslim or Non-Muslim (stored in the Users table).

In our Checklist table, I’ve added a column that specifies if that particular task (row) applies to only our Muslim users or non-Muslim users or everyone.

As for the layout, I’m currently displaying the Checklist on it’s own tab as a single collection.

My question is, how do I go about only showing the tasks (rows) that are relevant to that particular user based on the religious preference that they’ve selected during onboarding?

Steps:
During signup add a field that gets their religion (I’m sure you’ve done that)
Select options on the layout tab of the table you’re working with.
Click on Add filter
Then create the filter it should be like
when Religion (on the checklist table) is Relion (on the user profile table - to get here: User profile > Religion)

Just make sure the values are the same

Another way is to create a relation on the (checklist item) that says Religion is Religion (on the user profile)

1 Like

Thanks Michael, I’ve tried what you suggested and it works for tasks that are specifically for Muslim and non-Muslim users.

But what about the 3rd kind of tasks that should appear to both of these users (everyone), any way I can work that in?

Adjust your filter to include both.

If religion matches X OR Both.

1 Like

Sorry Jeff, I’m not sure I follow. What do you mean by both? How do I do that given the current structure:

User’s Religion (Users table)

  • Muslim
  • Non-Muslim

Task Applicable To (Checklist table)

  • Muslim only
  • Non-Muslim only
  • Both

Set up the filter for the collection like this.

Religion Is User Profile → Religion
OR
Religion Is ‘Both’

3 Likes

Thanks Jeff, it worked perfectly. I have a follow-up question.

During onboarding, I also collect a bunch of other data from the user (also stored in Users table) including whether or not the deceased left a will, did they have any pets, etc. Is it possible to add another layer of filter based on their answers? This 2nd layer of filter applies to everyone (both Muslim and non-Muslim users).

And what’s the best way to structure the additional columns in the Checklist table?

Hi there. I’m a new user (three hours in) and just have one remaining issue in my app.

Similar requirement, I have a many-to-many relationship between two tables resolved in a joining table.

What I’m looking to do is click on a User in my User View and show their Sessions.

I’ve created a collection in my User layout which shows the unfiltered data have added relation and lookup columns in the many-to-many but I can’t work out how to add a filter where I say User/UserName = UserSessions/User Name.

Click on Name brings me here…

I’m sure that I’m doing something stupid but can you help me please?

Thanks

You should be able to use a Screen Filter.
UserEmail is Screen->UserEmail

1 Like

Thanks. I’ve got it working now but I’m not quite sure how :slight_smile:

Use an If-Then-Else column.

If Religion Is User Profile → Religion => true
If Religion Is ‘Both’ => true
then If Will Is ‘No’ => true

Add every condition you need and use that column to filter your checklist.