# Client filter with condition based on current user role does not work

**URL:** https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297
**Category:** Bug reports
**Created:** [February 23, 2023, 2:34pm UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297 "2023-02-23T14:34:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lequeuxa](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lequeuxa/32/128_2.png) [@lequeuxa](https://community.appfarm.io/u/lequeuxa)
#### Post date: [February 23, 2023, 2:34pm UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/1 "2023-02-23T14:34:59Z")

</div>

Hi,

Here it is 😉 :

ControlC solution, Extranet app.

client filter based on current user role:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/6a137b227f9b4fe4a3e52ffd6275b139a19d7101.png)

current user roles:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/7bf470591665dae9f5a2b1b6ddec69a7afe3368c.png)

task object class supposed to be filtered:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/7aa498e262b85bdb06f81a15265a72a67ada5545.png)

---

<div class="post-metadata">

### Author: ![Joanna](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/joanna/32/122_2.png) [@Joanna](https://community.appfarm.io/u/Joanna)
#### Post date: [February 23, 2023, 3:25pm UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/2 "2023-02-23T15:25:03Z")

</div>

Hi! Thanks for reporting. I was able to reproduce it, so it seems like a bug, I’ll register a challenge.

---

<div class="post-metadata">

### Author: ![Joanna](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/joanna/32/122_2.png) [@Joanna](https://community.appfarm.io/u/Joanna)
#### Post date: [March 20, 2023, 11:12am UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/3 "2023-03-20T11:12:48Z")

</div>

Hi @lequeuxa, just a quick update: the fix for this is coming in version 23.3 🙂

---

<div class="post-metadata">

### Author: ![Johan18](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/johan18/32/748_2.png) [@Johan18](https://community.appfarm.io/u/Johan18)
#### Post date: [November 28, 2023, 9:07am UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/4 "2023-11-28T09:07:31Z")

</div>

Hi @Joanna  
Is this issue resolved? I have a problem on checking condition on current user role. See pictures from console…

![Screenshot 2023-11-28 at 10.06.05](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/92f0a18322db021cb4ee35a3c931bea22515512a.png)  
 ![Screenshot 2023-11-28 at 10.05.21](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/389f0a272e1c0b42b4071a809dfd3f13b9ea2d9d.png)  
 ![Screenshot 2023-11-28 at 10.04.50](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/9ea16d9c5c1898b04584f83f63a99e4611a07e97.png)

 ![Screenshot 2023-11-28 at 10.04.40](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/26b80eef355083e1d36eff55858191d15c7e0bb6.png)

As you can see game master control (me) datasource is not empty, and current user role for Gameplanuser is false. so this condition should evaluate to true.

---

<div class="post-metadata">

### Author: ![Johan18](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/johan18/32/748_2.png) [@Johan18](https://community.appfarm.io/u/Johan18)
#### Post date: [November 29, 2023, 10:37am UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/5 "2023-11-29T10:37:58Z")

</div>

@lequeuxa is this issue resolved for you now?

---

<div class="post-metadata">

### Author: ![lequeuxa](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lequeuxa/32/128_2.png) [@lequeuxa](https://community.appfarm.io/u/lequeuxa)
#### Post date: [November 30, 2023, 7:26am UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/6 "2023-11-30T07:26:13Z")

</div>

Hi @Johan18,

I used a workaround, @Yassine.tebib might be able to answer as he is using Appfarm more often.

---

<div class="post-metadata">

### Author: ![Yassine.tebib](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/yassine.tebib/32/74_2.png) [@Yassine.tebib](https://community.appfarm.io/u/Yassine.tebib)
#### Post date: [December 1, 2023, 10:46am UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/7 "2023-12-01T10:46:58Z")

</div>

Hi @Johan18

looks like it work normally for me , i’m using kind of a similar filter as yours

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/06ff2365159453d9448788ec7336a011b1dbe0e2.png)

---

<div class="post-metadata">

### Author: ![Johan18](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/johan18/32/748_2.png) [@Johan18](https://community.appfarm.io/u/Johan18)
#### Post date: [December 12, 2023, 12:40pm UTC](https://community.appfarm.io/t/client-filter-with-condition-based-on-current-user-role-does-not-work/297/8 "2023-12-12T12:40:56Z")

</div>

Thanks Yassine  
I believe the cause of my problems was that the app variable was not readable (not initialized or something) since it is in an “On app load” action. So I solved it with a sleep.

Regards,  
Johan
