How to create dynamic groups by querying custom user attributes