How to set a value using Rules I want to add an additional field on each orders, and that field can be edited. I've installed the Field Collections module. I've added a field in the order settings using the Field Collection field type. Inside that field, I've created a textarea, created by and edited by field. I've used entity reference in created by and edited by to check which user created the field and who edited the field.

How can I set a default value (created by and edited by) when the order has been edited/newly added using rules? or if not possible to do this in rules, is it possible to achieve this in hook_form_alter?
I don't know if it's simpler, it really depends on your set up, but you could look at the Field default token module:


  This module enables to use tokens as field default values.


with this you can assign default values using tokens, such as current user, etc.