Skip to Content Skip to Menu

Update the cbactivity stream when a field has been updated

  • wintercorn
  • wintercorn
  • OFFLINE
  • Posts: 108
  • Thanks: 13
  • Karma: 1
2 days 16 hours ago #340359 by wintercorn
OK, a slightly complicated one.

I have a field which is a Yes/No radio button and the default option is Pending. I'd like that when Yes or No are selected it updates the cbactivity stream with a comment containing the current user and the answer they selected. 

I've tried with various Auto Actions but none work. Which is the right config?

Not hugely important, but would be nice.

Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48844
  • Thanks: 8346
  • Karma: 1449
2 days 15 hours ago - 2 days 15 hours ago #340361 by krileon
That's doable. The below should work in CB Auto Actions. It's basically your standard "do something when a field value changes" auto action except with a CB Activity action to generate an activity entry.

Global
Triggers: onAfterUserUpdate
Type: CB Activity
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: FIELD_HERE
Operator: Not Equal To
Value: Pending
Condition 2
Field: Custom > Value
Custom Value: [var1_FIELD_NAME_HERE]
Operator: Not Equal To
Value: [var3_FIELD_NAME_HERE]
Action
Mode: Activity
Method: Create
Published: 1
Stream: Profile Activity
Asset: profile.[user_id]
Title:
Code:
toggled FIELD_TITLE_HERE to [cb:userfield field="FIELD_NAME_HERE" /]

Load By: None

For FIELD_HERE be sure to select your field. Replace FIELD_NAME_HERE with the name of the field you want to condition for. This ensures the auto action only processes when the field changes and only if that value isn't set to your default Pending value.

All the other parameters can be left at their default empty values. You can freely adjust them however needed though. The title/message displayed is just an example and can be whatever you like. I went with title as it's not changeably by the user like Message is and it'll show directly next to their name as an action performed.

The end result of all of this would be the following.

 


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.
Last edit: 2 days 15 hours ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum