1

I have added a custom field (taxonomy reference) to my users. Now I want to run a rule based on the values in that field, but the field does not show up in the available items on the "data selection".

Any ideas on why the field does not show up in rules or how to make it show up in rules is greatly appreciated.

field configuration:

langcode: en
status: true
dependencies:
  config:
    - field.storage.user.field_workbench_access_groups
    - taxonomy.vocabulary.intranet_units_committees_and_gr
  module:
    - user
id: user.user.field_workbench_access_groups
field_name: field_workbench_access_groups
entity_type: user
bundle: user
label: 'User's Workbench Access Groups'
description: ''
required: false
translatable: false
default_value: {  }
default_value_callback: ''
settings:
  handler: 'default:taxonomy_term'
  handler_settings:
    target_bundles:
      intranet_units_committees_and_gr: intranet_units_committees_and_gr
    sort:
      field: name
      direction: asc
    auto_create: false
    auto_create_bundle: ''
field_type: entity_reference

Reaction Rule:

langcode: en
status: true
dependencies: {  }
id: sync_existing_user_workbench_access
label: 'Sync Existing User --> Workbench Access'
events:
  -
    event_name: 'rules_entity_update:user'
description: ''
tags: {  }
config_version: '3'
expression:
  id: rules_rule
  conditions:
    id: rules_and
    conditions:
      -
        id: rules_condition
        context_values:
          type: user
        context_mapping:
          entity: user
        context_processors:
          type:
            rules_tokens: {  }
        provides_mapping: {  }
        condition_id: rules_entity_is_of_type
        negate: false
      -
        id: rules_condition
        context_values:
          field: field_workbench_access_groups
        context_mapping:
          entity: user
        context_processors:
          field:
            rules_tokens: {  }
        provides_mapping: {  }
        condition_id: rules_entity_has_field
        negate: false
  actions:
    id: rules_action_set
    actions: {  }
2
  • Duplicate of drupal.stackexchange.com/questions/236650/… – anonymous Jun 9 '20 at 2:19
  • Thank you for pointing to that question. It answered my concerns. I did not find it in my search. I believe I didn't find it because the title of the question "Access user profile data" did not describe a connection to rules. I do try to search before posting. – Kevin Finkenbinder Jun 9 '20 at 14:27
1

As @anonymous pointed out, it is answered in Access user profile data. Since that post is not well labeled in connection with rules, I will also post the answer here. In short, instead of verifying Entity is of Type, verify that entity is of bundle. Entity of Type should work, but that it does not is (apparently) a known bug with Rules 8.x-3.x as of this time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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