I am using the rules module to automatically create a taxonomy term when i create content of a certain type. I would also like to automatically populate the taxonomy term reference in the the created content. I have tried many different configurations using the set data function in rules however it does not ever set the taxonomy term to the the new-term which is created.
Is there any way that this operation can be carried out using rules.
I have exported the rule for you to take a look at.
/**
* @file
* advertising_region_creator.rules_defaults.inc
*/
/**
* Implements hook_default_rules_configuration().
*/
function advertising_region_creator_default_rules_configuration() {
$items = array();
$items['rules_auto_taxonomy'] = entity_import('rules_config', '{ "rules_auto_taxonomy" : {
"LABEL" : "Auto Taxonomy",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules" ],
"ON" : [ "node_insert" ],
"IF" : [
{ "node_is_of_type" : {
"node" : [ "node" ],
"type" : { "value" : { "savings_viewer" : "savings_viewer" } }
}
}
],
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "taxonomy_term",
"param_name" : "[node:title]",
"param_vocabulary" : "2"
},
"PROVIDE" : { "entity_created" : { "new_term" : "New Term" } }
}
},
{ "data_set" : {
"data" : [ "node:field-savings-viewer-region" ],
"value" : [ "new-term" ]
}
}
]
}
}');
return $items;
}
I apologize if this is posted in the wrong format I am new to all of this but will keep trying to get better.