I have a content type with name hotel
it have entity reference
field that referenced to users
entity, I want when admin create a node automatically created a user according to hotel email field
and then set user entity reference
field with that new created user.How can I do it automatically?
I create a rule with below structure but not work
{ "rules_create_user_based_on_hotel" : {
"LABEL" : "create user based on hotel",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_insert--hotel" : { "bundle" : "hotel" } },
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "user",
"param_name" : "[node:field_hotel_users]",
"param_mail" : "[node:field_mail_hotel]"
},
"PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
}
},
{ "data_set" : { "data" : [ "node:field-user-ref" ], "value" : [ "entity-created" ] } }
]
}
}
"data_set" : { "data" : [ "node:field-user-ref" ], "value" : [ "entity-created" ]
, use[ "entity-created:uid" ]
instead of it