How to use Rules to auto populate field B with the value of field A after saving a new node or updating an existing one? This must be easy, but I just can't figure it out ...

My scenario is like so:


I have a content type with field A (title_field - text field) (that contains the title) and field B (field_tagged_as taxonomy reference).
I need to auto populate field B with the value from field A, after saving a new node or updating an existing node.


Is there a way to do this using the Rules module?
Here is a rule (in Rules export format) that does exactly what your question is about:

{ "rules_auto_populate_fields" : {
    "LABEL" : "Auto populate fields",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_presave" : [] },
    "IF" : [
      { "entity_has_field" : { "entity" : [ "node" ], "field" : "title_field" } },
      { "entity_has_field" : { "entity" : [ "node" ], "field" : "field_tagged_as" } }
    ],
    "DO" : [
      { "data_set" : {
          "data" : [ "node:field-tagged-as" ],
          "value" : "[node:title-field]"
        }
      }
    ]
  }
}


Notice the "entity has field" conditions, for both fields. Those conditions will make the fields available in the Rules Action ... (so that you can reference field A and set the value of field B).

If you have the Rules UI enabled, and if the machine names of your fields are indeed "title_field" (for field A) and "field_tagged_as" (for field B), you should be able to just import this rule in your own site. If you're using other machine names, just adapt the machine names prior to importing this rule (and apply similar changes in the fields mentioned in the Rules Action).