Skip to Content Skip to Menu

Update field from #__users

  • SVCC
  • SVCC
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
6 years 11 months ago #299079 by SVCC
Update field from #__users was created by SVCC
Is there a way to use auto actions to populate the users email address from #__users to an email field [cb_email] on user login?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 11 months ago - 6 years 11 months ago #299080 by krileon
Replied by krileon on topic Update field from #__users
Yup, but why are you needing a copy of the email address in a second field? You should be able to just use a [FIELD_NAME] substitution for email anywhere that supports substitutions. Example as follows on how to copy 1 field value to another on login.

Global
Triggers: onAfterLogin
Type: Field
User: Automatic
Access: Everybody
Action
Field: Email
Operator: Set
Value:
Code:
[email]

You may also want to add a condition so it's not saving the user object on every login. Example as follows.

Conditions
1: [cb_email] Not Equal To
Code:
[email]


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: 6 years 11 months ago by krileon.

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

  • SVCC
  • SVCC
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
6 years 11 months ago #299083 by SVCC
Replied by SVCC on topic Update field from #__users
Thanks! I knew how to do it... should have followed my instincts and tried it. The reason for the second field is that I wanted to display this on a separate tab that is only visible to moderators. I also wanted to display the email address and not just a blind link to email them.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 11 months ago #299084 by krileon
Replied by krileon on topic Update field from #__users
Since you only need it for display purposes I suggest just using a Custom HTML field with the below substitution.

Code:
[email]

You then won't need to deal with storing it twice.


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: SVCC

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

Moderators: beatnantkrileon
Powered by Kunena Forum