Forums

Save user assign group according to switch

vismay 14 Jul, 2017
Hello,

in the save user action is possible to assign a user group according to a switch?

Example:

I have a radio box with a switch action : 1 and 2.

If 1 I need to assign user group 10, if 2 assign user group 11.

I see the shortcode:

Groups ids provider
{value:[10]}

but how to set the if status?

Thanks
Max_admin 15 Jul, 2017
Hi vismay,

Drag a switch action above the save user, then set the "data provider" of the switch to {data:radio_name} then set the values as following:

1:[10]
2:[11]


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vismay 16 Jul, 2017
Sounds good!

I've solved with a custom database query.

But this solution it's lighter.

I will try...
vismay 16 Jul, 2017
...ok, and then in the save user action:
Groups ids provider: {value:{var:name_of_switch_action}} ?
Max_admin 16 Jul, 2017
Hi Vismay,

No, in the "Groups id" provider you need to call the switch function: {fn:switch_fn_name}

Because here the switch will run and return the value directly, unless you enable the "return result as var" setting.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.