# Icon color change when users are logged out

**URL:** <https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228>\
**Category:** Need help\
**Created:** [November 9, 2017, 1:34pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228 "2017-11-09T13:34:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![009jac](https://avatars.discourse-cdn.com/v4/letter/0/b4bc9f/32.png) [@009jac](https://forum.bubble.io/u/009jac)\
**Post date:** [November 9, 2017, 1:34pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/1 "2017-11-09T13:34:23Z")

</div>

Hi All

I have an employees list to show which users are logged in/out  
now when they are logged in, the icon goes green, and not logged in must be red. Now i created 3 test profiles, but they all show green, even with them being signed out.

How can i get users who aren’t logged in to show red icon?

I used conditions on the icon: red: Current cell’s user isn’t logged in  
Green: current cell’s user is logged in

---

<div class="post-metadata">

**Author:** ![vincent56](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vincent56/32/16009_2.png) [@vincent56](https://forum.bubble.io/u/vincent56)\
**Post date:** [November 9, 2017, 1:37pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/2 "2017-11-09T13:37:31Z")

</div>

maybe just have a red icon by default and only add the condition green for when the user is logged in?

---

<div class="post-metadata">

**Author:** ![009jac](https://avatars.discourse-cdn.com/v4/letter/0/b4bc9f/32.png) [@009jac](https://forum.bubble.io/u/009jac)\
**Post date:** [November 9, 2017, 1:49pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/3 "2017-11-09T13:49:26Z")

</div>

I tried that, but it still shows that all 3 test profiles are logged in (Showing green)

---

<div class="post-metadata">

**Author:** ![andrewgassen](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/andrewgassen/32/44248_2.png) [@andrewgassen](https://forum.bubble.io/u/andrewgassen)\
**Post date:** [November 9, 2017, 2:01pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/4 "2017-11-09T14:01:53Z")

</div>

I think I recall another thread talking about how the “user isn’t logged in” doesn’t work like this. I know some folks had to go to some pretty insane lengths to get a status indicator like what you’re looking for, like keeping a log of every single interaction a user does, and checking to see if the last interaction was made less than 5 minutes ago. It looked like a pain. If I find the thread, I’ll add it here.

---

<div class="post-metadata">

**Author:** ![am.experts.online](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@am.experts.online](https://forum.bubble.io/u/am.experts.online)\
**Post date:** [November 9, 2017, 2:06pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/5 "2017-11-09T14:06:38Z")

</div>

I would think the easiest way is to create a field called `is_loggedin` in the user table.

Then in your login event you set this field to 1 when user logs in. When they log out set it to 0.

Now in the conditions of the icon if user is\_loggedin field is 1 then set to green.

---

<div class="post-metadata">

**Author:** ![009jac](https://avatars.discourse-cdn.com/v4/letter/0/b4bc9f/32.png) [@009jac](https://forum.bubble.io/u/009jac)\
**Post date:** [November 9, 2017, 2:43pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/6 "2017-11-09T14:43:32Z")

</div>

Sorry i am still new to this whole thing and still learning.

Can you please explain this more in detail?

---

<div class="post-metadata">

**Author:** ![am.experts.online](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@am.experts.online](https://forum.bubble.io/u/am.experts.online)\
**Post date:** [November 9, 2017, 2:48pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/7 "2017-11-09T14:48:03Z")

</div>

I have edited my reply.

---

<div class="post-metadata">

**Author:** ![andrewgassen](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/andrewgassen/32/44248_2.png) [@andrewgassen](https://forum.bubble.io/u/andrewgassen)\
**Post date:** [November 9, 2017, 4:43pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/8 "2017-11-09T16:43:38Z")

</div>

The issue with this approach is that most users don’t explicitly “log out.” They’ll close the browser window or walk away, but won’t always hit the “log out” button, meaning this may never change back to zero.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [January 18, 2018, 1:34pm UTC](https://forum.bubble.io/t/icon-color-change-when-users-are-logged-out/20228/9 "2018-01-18T13:34:29Z")

</div>

Closed on January 18, 2018, 1:34pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
