2

I am new to Drupal. Trying to get it work with Rules module.

I have added new field (decimal type) to user: field_user_custom which I can see in DB as user__field_user_custom as a table.

I want to add value to this table on each article update.

I have setup rule as this:

  1. Create a Reaction rule
  2. React on Event: "After updating content"
  3. Action:

    a. Type: set data

    b. Data Value: @user.current_user_context:current_user:field_user_custom

    c. Value: 888

However, on article update, this value is not updated. I have tested if the rule is applied with having System Msg and it throws the msg but doesn't update the user field.

I doubt my Data Value is not correct. Which is why I have tried with this:

  • user:field_user_custom

but this didn't help either. What am I missing?

  • chances are that you're missing this – Pierre.Vriens May 1 '17 at 7:45
  • Sorry, didn't get you. Do you mean I haven't installed this module? Like I said, it show the sys msg already. – Adarsh Khatri May 1 '17 at 8:28
  • which release of it? – Pierre.Vriens May 1 '17 at 8:30
  • Version 8. Tried with both. – Adarsh Khatri May 1 '17 at 8:36
  • Sorry but there are multiple releases for Drupal release 8, so can you be more accurate to indicate something like alfa1, alfa2, betaX, RcY ? – Pierre.Vriens May 1 '17 at 8:40
0

You were close. It's actually @user.current_user_context:current_user.field_user_custom, per "Set a data value"?.

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.