How to set "Entity has Field" when the Rules Event is unrelated to the entity? In Rules, I am trying to update/calculate a field in the User's account upon completion of a commerce payment.

The condition data selector obviously only wants to populate commerce related fields, since my Event is "After saving new payment".

How can I define my custom field in the Rules Conditions?

My attempts to set the user or current-user entity has field are unsuccessful. But I know this must be simple.
Here are the steps to get this to work (whatever your existing Rule looks like ...):


Assume your current rule has some actions (= SomeRulesActions).
Create a new Rules Component like so:


Use parameters related to the user (= say ParmUser) and  payment (= say ParmPayment).
Add the Rules Conditions related to your custom field, which you should have available via the ParmUser.
Add Rules conditions identical to SomeRulesActions, using ParmUser and/or ParmPayment.
QA-test your Rules Component using the "Execute" link in front of it (in the Rues UI).

Update your existing rule like so:


Delete all Rules Actions corresponding to SomeRulesActions (their equivalents are now included in the Rules Component you created in the previous step.
Add a Rules Action to execute the Rules Component you created in the previous step.



Easy, no?

An alternative solution where you don't need an extra Rules Component, is to rework your Rules logic by using the Conditional Rules module. If you wonder how to do that, use this link.

Ps: I'm assuming this is about D7.