Adding content to a field

4 years 8 months ago #313295 by ericmuc
Adding content to a field was created 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

Please Log in to join the conversation.

4 years 8 months ago #313298 by krileon
Replied by krileon on topic Adding content to a field
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 - 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.

4 years 8 months ago - 4 years 8 months ago #313299 by ericmuc
Replied by ericmuc on topic Adding content to a field

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?

Please Log in to join the conversation.

4 years 8 months ago #313300 by krileon
Replied by krileon on topic Adding content to a field
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 - 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.
The following user(s) said Thank You: ericmuc

Please Log in to join the conversation.

4 years 8 months ago - 4 years 8 months ago #313301 by ericmuc
Replied by ericmuc on topic Adding content to a field

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.

Please Log in to join the conversation.

4 years 8 months ago - 4 years 8 months ago #313302 by ericmuc
Replied by ericmuc on topic Adding content to a field
I have deleted the field_3 and created it new. Now it works.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.713 seconds

Facebook Twitter LinkedIn