Skip to main content
1 of 2

Filter users: in group AND not in other group

Please could you advise on how to filter a user query, so that users from Group A are included, but not if they are also in Group B?

{% set vnp_users = craft.users .group(['groupA', 'not groupB']) .orderBy('field desc') .all() %}