[SOLVED] Set field value depending on other fields

11 years 10 months ago - 11 years 10 months ago #205118 by travelmonkee123
I have previoulsy posted partially about this, I have three profile types, e.g.:

Male
Female
Alien

I have a reg page like so:

What are you? []Human []Alien
What Gender? []Male []Female

It is setup so the gender question only shows when 'Human' is selected and everything behaves nicely, now I need to find out how to set cb_profiletype based on these two questions to one of the three types. CB Conditionals afaik doesn't let you set a field's value, just whether it is hidden/required.

Please Log in to join the conversation.

11 years 10 months ago #205119 by nant

Please Log in to join the conversation.

11 years 10 months ago #205122 by travelmonkee123
Replied by travelmonkee123 on topic Re: Set field value depending on other fields
Installed CB Auto Actions and tried:

Published: Yes
Type: Field
Triggers: onStartSaveUserRegistration,onBeforeLogin
User: Automatic
Access: Everybody
Conditional: cb_regsecondtype (my gender field) Does Contain Male
Field: Profile Type
Operator: Set
Value: Male

Not working, is there anything I've done wrong?

Please Log in to join the conversation.

11 years 10 months ago #205200 by krileon
Replied by krileon on topic Re: Set field value depending on other fields

Triggers: onStartSaveUserRegistration,onBeforeLogin

These triggers probably won't work to alter a user. Use after registration and after login for best results.

Conditional: cb_regsecondtype (my gender field) Does Contain Male

That is not a substitution. Please use [cb_regsecondtype].


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 10 months ago #205290 by travelmonkee123
Replied by travelmonkee123 on topic Re: Set field value depending on other fields
I did all that and it didn't work still, turns out you can't use, say 'Awesome Male' as the value to set it to, it has to be the alt; 'awesome-male'.

Please Log in to join the conversation.

11 years 10 months ago #205312 by krileon
Replied by krileon on topic Re: Set field value depending on other fields
You have to set it to the exact value that's specified in the field as seen in Field Management while editing the field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.229 seconds

Facebook Twitter LinkedIn