I'm using Rules and Profile2 in a D7 site.

I'm looking for help to check my logic for the following rule. I can't get it to work and don't know where I'm going wrong.

Event: After saving a new profile

Condition: Data Comparison--> Selected data: site:current-user:profile-main:field-become-a-distributor

Action: send e-mail

Condition is what breaks. Here is what is in my error log:

Unable to get the data value for the variable or parameter data. Error: Unable to get the data property field_become_a_distributor as the parent data structure is not set.

  • Are you using profile 2 module and and field-become-a-distributor is your field ? Commented Dec 12, 2012 at 5:16
  • Yes. That is exactly the case.
    – astanley86
    Commented Dec 12, 2012 at 16:14
  • Any information on this? I´m lloking for this functionality too. Thanks!
    – Rosamunda
    Commented May 1, 2013 at 22:47

2 Answers 2


Your question is a bit cryptic, but here are a few hints of what might possibly be causing your error:

  • The token site:current-user:... that you're using in your Rules Condition may not be the correct token to be used. E.g. think of some (super) admin (like user/1) who is triggering the Rules Event you're using (but for an account which is different from user/1) ... In this scenario, your Rules Condition refers to a field related to ... user/1 (and not the account that triggered the Rules Event).
  • You're trying to access that token in your Rules Condition, but are you sure its value is available? To be sure of that, preceed that Rules Condition by an "Entity has field" Rules Condition (for the account for which a new profile is being created, and for the field you're trying to use in your Rules Condition).
  • If none of the previous hints solve your issue, it may be that you also need to perform a "Fetch entity by ID" (for the account being created), as your first Rules Action. And then combine this with the execution of a Rules Component (with parameter the data returned by the "Fetch entity by ID"), whereas you replace your existing Rules Condition by an equivalent Rules Condition of that Rules Component, and with your existing Rules Action (to send an eMail) also moved to an equivalent Rules Action in that Rules Component.
  • 1
    I guess this proves that it's never too late to answer "old" questions.
    – No Sssweat
    Commented Feb 20, 2017 at 8:46
  • @NoSssweat : "I guess"??? I'd rather say there is no need for such guessing. Maybe you should rather ask something like "how do you find 'unanswered' questions like these, which are worth (still) posting an answer for?" ... Actually it's even more fun IMO to go after questions with accepted answers which are incoplete or wrong, and then post a correction / addition to those via an extta answer. PS: probably D4 or D5 tagged questions would be a real waste of time/effort ... Commented Feb 20, 2017 at 9:14

Use Data selector account:field-YourField

  • Can you expand a little bit where setting this should be applied to?
    – mpdonadio
    Commented Jun 18, 2013 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.