Why is unchanged and new value always the same in my Rules condition? I have a boolean field called verified defined in profile2. When this field changes from not ticked to ticked I would like to send out an email to the user. Easy I thought with rules

Starting using "After updating an existing profile" then comparing the fields
profile2-unchanged:user:profile-directory-information:field-verified
and
profile2:user:profile-directory-information:field-verified
(bascially saying equal and then negating the condition)

   "IF" : [
      { "user_has_role" : {
          "account" : [ "profile2:user" ],
          "roles" : { "value" : { "12" : "12" } }
        }
      },
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "3" : "3", "28" : "28" } },
          "operation" : "OR"
        }
      },
      { "NOT data_is" : {
          "data" : [ "profile2-unchanged:user:profile-directory-information:field-verified" ],
          "value" : [ "profile2:user:profile-directory-information:field-verified" ]
        }
      }
    ],


However they are always the same value and the rule never fires. However when I take out the condition and send myself an email with the two values. One is true the other one is false.

also tried this in the condition:

  { "data_is" : {
      "data" : [ "profile2-unchanged:user:profile-directory-information:field-verified" ],
      "value" : 0
    }
  },
  { "data_is" : {
      "data" : [ "profile2:user:profile-directory-information:field-verified" ],
      "value" : 1
    }
  }


which is also not working. Tried to move it in before saving a profile, and also in various save user events. Always the same result. So why are the values different in Actions then they are in conditions?

Am I missing something here?
Rule refinements

Entity has field

Make sure to add a Rules condition Entity has field (related to your additional profile2:user:profile-directory-information:field-verified-field in your Rules condition). And make sure to add that Entity has field condition BEFORE the condition you already have.

For a video tutorial that illustrates the importance of this Entity has field condition, refer to Data types and data selection, especially what is shown between about 13:30 and 17:30 in it.

Add ":value" to your fields

Adapt your rule by adding :value to both of your fields, so that they look like so:


profile2-unchanged:user:profile-directory-information:field-verified:value
profile2:user:profile-directory-information:field-verified:value


Rules debugging

If none of the above helps, then move on to Rules debugging, as explained in my answer to "How can I display the value of a variable inside a condition?".

Depending on what the result of that type of debugging is, you may also want to (temporary) enable the Devel module, so that you can (temporary) add a Rules Action like "Display a value" (in your case of your profile2:user:profile-directory-information:field-verified).