How to make a new field type visible to the Rules module? I have installed the Examples for Developers module, and enabled the Field Example submodule. It creates a new field type called field_example_rgb.

I've added this field to a new content type. I'm trying to set and/or display the value of the field using Rules - to no avail. Rules does not "see" the field in the node.

I've tried adding a file called field_example.rules.inc that implements hook_rules_data_info(), still without luck. Can someone please help me figure out how to make the field visible to Rules?

This is the code of the hook_rules_data_info() 

   function field_example_rules_data_info() {
  return array(
    'field_example_rgb' =&gt; array (
      'label' =&gt; t('example color rgb'),
      'wrap' =&gt; TRUE,
      'property info' =&gt; array(
        'rgb' =&gt; array(
            'type' =&gt; 'text',
            'label' =&gt; 'RGB',
        ),
    ),
    ),
  );
}
Just add the property_type key to the array you already have, like so:

'property_type' =&gt; 'text',


With that added line, the Entity API knows how to handle that field.

For a more complex field, such as fields with more than one database column, it is not enough to simply declare the property type. You need to specify further callbacks that may alter the generated property info. To do so, you need to use the key property_callbacks to add a custom callback function that will provide the extra metadata required. For example:

'property_type' =&gt; 'field_example_rgb',
'property_callbacks' =&gt; array('field_example_rgb_property_info_callback'),


Source:
Describe field properties to make custom fields work with Entity Metadata Wrappers, which includes some more info about this topic also.