99 Posts
SimonD
8 years ago
Topic

Hello Seblod Community,

I'm working on a small community project and would like to automatically assign user to one or several predefined usergroup(s).

In my registration form, I've created a select field the values of which could be used to assign in which usergroup(s) to regsiter the user: ie if user select option a, he is assigned to group A, if he selects option b, he is assigned to group A and group B.

My first idea was to use Conditional states: in my form I've added a User Groups field and added a conditional state on it to be filled with the value of a group (id of the group) when my custom select field is filled with specific value(s).

It is not working.

Am i wrong by using conditional states? Should I use another way to achieve this?

Thank you for helping

Simon

Get a Book for SEBLOD
4229 Posts
Kadministrator
8 years ago
1
Level 1

You can create new select simple field with storage Standard - User - groups (same as User Groups field), then have a and b as text a=5 b=3,4

99 Posts
SimonD
8 years ago
0
Level 2

Hi Klas,

Thank you for your reply.

It's working.

8 years ago
0
Level 1

I tried mentioned solution above for about 1 hour. I finally managed to achieve the correct result. I have probably set up the field as text field in the first place and altered it later to be a select field. This might have caused some problems. I have deleted the field and created a new simple select field. Storage as mentioned and it worked fine. Not sure why, but this was my solution.

Get a Book for SEBLOD