If field date is 15 days away from today, change another field value

by Drii7   Last Updated November 27, 2017 12:07 PM

OK, this is specific:

I have a content type with two fields:

  1. First is a expiration date field (d-m-y format);
  2. Second is a select list field: "green, red, yellow, empty"

WHAT I NEED:

When there is 15 days left for the expiration date of a specific node, the select list field from that node should automatically change to "yellow".

Is this possible using, for example, rules module? Is there any other option?

Thank you!

Tags : fields rules


Answers 1


Hmm.. This sounds like it could be done with Rules and VBO.

  1. Create a VBO view of nodes that match your date requirement using filter date field > relative date. You might also want to filter out nodes that have already been changed.
  2. Create a rule:

    • Event: Cron or maybe the Rules Once per Day module
    • Action: Load a list of entity IDs from a VBO view
    • Action: Loop list
    • Action: Change / Add field using Set a data value if it's a single value field or Add item to list if it's a multi-value field.

EDIT: As of November 2017, this feature whereby VBO supplies Rules has been a bit broken and requires a patch to work.

Niall Murphy
Niall Murphy
August 20, 2016 04:04 AM

Related Questions





Is there a way to see what fields are used in Rules?

Updated November 30, 2017 09:07 AM

How to expose a select field to Rules?

Updated April 18, 2015 23:03 PM