Adding content to a field

4 months 3 weeks ago #313295 by ericmuc
Please advice the best way to save content of two different fields into a third field:
"[Field 1] [Field 2]" = [Field 3]
Trigger: saving data in one of the two fields
Thanks
4 months 3 weeks ago #313298 by krileon
You'd need to use CB Auto Actions for that acting on the onAfterUserUpdate trigger (and onAfterUpdateUser if you also want to include backend updates) with a Field action. Example as follows.

Global
Triggers: onAfterUserUpdate
Type: Field
User: Automatic
Access: Everybody
Action
Field: FIELD_3
Operator: Set
Value: [FIELD_1] [FIELD_2]

This assumes you need the value actually stored in the database. If you don't need it stored in the database I recommend just making Field 3 a Custom HTML field then substituting in field 1 and 2.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
4 months 3 weeks ago - 4 months 3 weeks ago #313299 by ericmuc

krileon wrote: You'd need to use CB Auto Actions for that acting on the onAfterUserUpdate trigger (and onAfterUpdateUser if you also want to include backend updates) with a Field action. Example as follows.

Global
Triggers: onAfterUserUpdate
Type: Field
User: Automatic
Access: Everybody
Action
Field: FIELD_3
Operator: Set
Value: [FIELD_1] [FIELD_2]

This assumes you need the value actually stored in the database. If you don't need it stored in the database I recommend just making Field 3 a Custom HTML field then substituting in field 1 and 2.


Thanks, I've done the CB Auto Actions, the value is stored in [Field_3] in the data base, but not shown in the field in users in the admin backend and not in the profile. Field_3 is a string field with no special settings.

Do you have an idea?
4 months 3 weeks ago #313300 by krileon
The field doesn't display at all in backend and on profile or it displays as empty like nothing was stored in it? If it's not displaying at all ensure it's published within CB > Field Management and is set to display in the appropriate views (e.g. on profile if you want it displayed on profile). If it's empty check if you're applying any conditions to it via CB Conditional as if a condition is not met it will empty the field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
The following user(s) said Thank You: ericmuc
4 months 3 weeks ago - 4 months 3 weeks ago #313301 by ericmuc

krileon wrote: The field doesn't display at all in backend and on profile or it displays as empty like nothing was stored in it? If it's not displaying at all ensure it's published within CB > Field Management and is set to display in the appropriate views (e.g. on profile if you want it displayed on profile). If it's empty check if you're applying any conditions to it via CB Conditional as if a condition is not met it will empty the field.

The field has an value in the data bank (!) but nothing is shown in the backend and on profile. I have checked all, at the moment I have no further idea.
4 months 3 weeks ago - 4 months 3 weeks ago #313302 by ericmuc
I have deleted the field_3 and created it new. Now it works.
Moderators: beatnantkrileon
Time to create page: 0.479 seconds

Facebook Twitter LinkedIn