New Bug on the Visibility Feature?

Hi everyone,

First of all, I want to say I searched the whole community about this issue and didn’t find a similar one.

For context, this is a chat app.

First, what is happening in the Table section :

  1. I have a tab named Binome.

  2. In this tab, there’s the columns email_user1 and email_user2

Secondly, what is happening in the Layout section :

  1. I have 2 collections, 1 collection for user 1 and 1 collection for user 2 (I have created 2 collections because this is was the only to display “unread messages” for the correct user)

  2. As you can see below, it’s working perfectly. The signed-in user is seeing his conversations which where his connected e-mail is email_user1 (the user 2 is also seeing his conversations based on the condition where his email_user2 is recongnized as e-mail of the signed-in user.)

Here’s the glitch

The collection is NOT visible for ALL the other user of the Binome table.

Only user 1 and user 2 of the FIRST LINE of the Table can see their conversation. Not the others.

What did I try to fix this issue :

  • Using only filtering
  • Creating an IF column to check if the user1 is the connected user and changing the visibility condition
  • I tried using the function Make Owner for the email column but it crashed the “unread messages” function

At this point, I’m really wondering if I’m DUMB, so your help would be greatly appreciated !

Thanks !

Pierre

Actually I think I understand, it will only display if the email_user1 is the same one on all the lines

I’m not sure why you have to do this. If you have a user-specific column to determine if a message was read or not, wouldn’t it be able to show that in a single collection?

You can structure this with If-Then-Else columns I think.

I think you’re using the wrong thing. Visibility is applied on the component level, tied to your screen’s data. What you would want is filtering the data.

1 Like

Hello @ThinhDinh - thanks for your answer

Finally, I was able to filter the data at the Navigation level

I just tested and unfortunately, Glide is not able to understand the unread_colmun should be checked for user 2 and not user 1, so on so forth.

So I have to find another way to create the unread function while filtering the data on the same column

For information, before that, I created 2 columns (unread_user1 and unread_user2) so that when user1 sends a message, an action would check the unread_user2, so on and so forth.

I think you could have a single user specific boolean column instead of one for each user. Instead of checking the box to mark it as unread, don’t do anything with it and instead only check the box when the message is read. You should only need one checkbox for any number of users since it will be user specific. If the box is unchecked for a user, then it’s unread.

1 Like

On top of what Jeff suggested, I would have an extra action when the users click the chat item to set the current date/time to a user-specific date/time column.

Then any messages that are before that date/time value is considered read.

1 Like

Unfortunately, it doesn’t work because the same user that just sent the message is also seeing the message as unread

Then you can try adding what I said above to the flow. Set the current date/time to the column when the user sends a message as well.

Well, the user that creates the message would set the boolean as true. Since it would be a user specific boolean, it would still be unchecked for the second user. So in the end, the boolean would be set to true whenever a message is created and whenever it’s viewed.

But as @ThinhDinh suggests, you may be better off just tracking dates instead.

1 Like

Thank you for your help guys!

On the table side, it’s finally working, but unfortunately, I don’t think I have the ability to check/uncheck the ‘unread’ column for the recipient, only for the sender.

Since it’s a user-specific column.

Will try to find how to bypass this limit.

Also, I have to admit that I didn’t understand how tracking the time might help

Essentially the recipient would call an action when they view the message, which would check the box. My thought is that unchecked=unread and checked=read. I think you are trying to do it the other way around where check=unread, which is a lot harder to achieve.

If you record the timestamp in each message row when it’s created, then you can retrieve the greatest timestamp and compare it to a global user specific timestamp for the entire conversation. If the date recorded the last time a user viewed the conversation is less than the last message date, then they have unread messages. If the date is greater than or equal to the last message date, then they don’t have any unread messages.

3 Likes

THANKS GUY ! It’s finally working ! I was stuck on this since 10 days lol…

I wasn’t aware that the column if-then-else would follow the user-specific logic. I did something (I don’t know what) but at first, it wasn’t following this logic but now, IT DOES :smiley:

2 Likes