I am trying to use Rules to update a user first name, last name and email address (by copying from a separate node). It's not working, with no error messages but I wonder if I'm trying to do something that's not permitted anyway.

Is it not possible to update user account data from a Rule?

Comments

maranjo created an issue. See original summary.

TR’s picture

Status: Active » Closed (works as designed)

Of course it's possible. Here's an example of a working Rule that assigns an "Employee" role when a new user is created with a company email address (the company domain here is example.com).

{ "rules_assign_to_employee_role" : {
    "LABEL" : "Assign to Employee role",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "user_insert" : [] },
    "IF" : [
      { "text_matches" : {
          "text" : [ "account:mail" ],
          "match" : "@example\\.com*",
          "operation" : "regex"
        }
      }
    ],
    "DO" : [
      { "user_add_role" : { "account" : [ "account" ], "roles" : { "value" : { "5" : "5" } } } }
    ]
  }
}

You didn't export your Rule, or describe your data model (how are you storing first name etc - Profile? Custom fields? Custom module?) so we can't see exactly what you're trying to do and we can't suggest how to make it work for your situation.

You can always turn on Rules debug in the Rules configuration so that you will get debugging output in your dblog - that can help you to figure out where you've make a mistake in your Rule.

nattyweb’s picture

Thanks (TR) for taking the time to reply. As my request was 3 years ago, I expect I solved it a different way, but thank you anyway - I appreciate it!