Skip to Content Skip to Menu

Auto Action on progress field

2 years 8 months ago - 2 years 8 months ago #328416 by laurent.peythieux
Auto Action on progress field was created by laurent.peythieux
Hello,

I have a progress field in my profile (cb_profil_complet).
I want to add points to the user if the profile is complete (cb_mespoints).
I tried using autoaction on onAfterUserProfileSaved (on cb_profil_complet filed or value) but it doesn't work. It seems that the field doesn't store a number or a % (and i dont find what is stored in database).
Can you help me on Conditions parameters ?
Thanks.
Last edit: 2 years 8 months ago by laurent.peythieux.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago #328453 by krileon
Replied by krileon on topic Auto Action on progress field
You should be able to condition against it fine. When accessing its raw value it'll be a value from 0-100. There won't be a % sign in its value, but it's a percentage. You may need to use a substitution though. Example as follows.

Field: Custom > Value
Custom Value: [cb_profil_complet]
Operator: Equal To
Value: 100


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 or Create an account to join the conversation.

2 years 8 months ago #328455 by laurent.peythieux
Replied by laurent.peythieux on topic Auto Action on progress field
Thanks, this condition works when value is 100.
I still have a problem. I what to add points only if value change => Increase (if we already have completed the profile, i don't want to add points.

For my other fileds, to check if value change, i use :
OnAfterUserUpdate
Field: Custom > Value
Custom value : [var1_cb_profil_complet]
Operatour : Not Equal ("more than" in this case i think to execute only if value increase)
Value : [var3_cb_profil_complet]
This doesn't work in this case.

I certainly do something wrong but i don't find.
Thanks for your help.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago - 2 years 8 months ago #328457 by krileon
Replied by krileon on topic Auto Action on progress field
That's a bit more complicated. The var1 and var3 substitutions are accesses on raw values. The progress field has no raw value since it's not actually stored in the database, but is calculated on display. I don't think you'll be able to get the previous progress value.

What is your auto action doing exactly? Sometimes you can condition against whatever it's setting to make sure it doesn't get set twice. You mentioned adding points, but is there any tracking of this beyond just incrementing cb_mespoints? If not then there wouldn't be a way to use that as a condition.

You could instead condition against the values of the fields that the progress field is tracking. So for example if it's checking that cb_field1, cb_field2, and cb_field3 have values then you can also just condition all 3 instead of checking the progress percentage.


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 years 8 months ago by krileon.

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

2 years 8 months ago #328464 by laurent.peythieux
Replied by laurent.peythieux on topic Auto Action on progress field
Thanks for your answer.

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

Moderators: beatnantkrileon
Powered by Kunena Forum