I would like to populate/alter a field if one of the conditions (which is another field in the profile is the same as "another" user profile).
For example, User01's cb_department=human-resource and his cb_level=high..
When a new user, say User02 registers, he selects his cb_department=human-resource.. I would like the auto action to fire upon registration and populate User02's cb_level to "high" because his cb_department is the same User01's cb_department.
Meaning that the auto action needs to look for another user or user(s) with a cb_department of the same value and populate the cb_level field..
I hope you understand.. I am working around the value of the field should be something like this:
Field to alter: level (cb_level)
Operator: Set (Field=Value)
Value: [cb:userdata field ="cb_level" cb_department="***is the same as some other user's cb_department***"]
You'll need to use a CB Query Field to perform a database query and find an existing user of a department and grab their level then supply it as the value for your field. Example as follows
Query Field (cb_query):
Code:
SELECT `cb_level` FROM `#__comprofiler` WHERE `cb_department` = '[cb_department]' LIMIT 1
Field: Level
Operator: Set
Value: [cb:userfield field="cb_query" /]
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: 12 years 1 month ago by krileon.
The following user(s) said Thank You: edmundcheong
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.