# Schedule a log based on a quantity value

**URL:** <https://farmos.discourse.group/t/schedule-a-log-based-on-a-quantity-value/115>\
**Category:** Using farmOS\
**Created:** [October 26, 2019, 6:36pm UTC](https://farmos.discourse.group/t/schedule-a-log-based-on-a-quantity-value/115 "2019-10-26T18:36:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [October 28, 2019, 5:01pm UTC](https://farmos.discourse.group/t/schedule-a-log-based-on-a-quantity-value/115/4 "2019-10-28T17:01:11Z")

</div>

> Using hooks after logs are updated/created, fire off checks to see if a “rule” has been created for that circumstance

This would be pretty simple in a custom module. Not much code needed. Making it more flexible would be the challenging part… but…

There’s a module for that! And it’s called “Rules”! 🙂

> **[Rules](https://www.drupal.org/project/rules)**
>
> The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules).

I’ve held off including it in farmOS for a couple of reasons, but I’ve always thought it could be a really useful tool, especially for advanced users. It let’s you configure “rules” via the UI, that happen on specific “events/triggers”, are limited by “conditions”, and then execute specific “actions”.

It’s low-hanging fruit for someone who is hosting farmOS themselves to drop in and play around with.

One of the biggest reasons I haven’t added it “officially” to farmOS is that the Drupal 8 upgrade path has been a question mark. I haven’t looked at it in a while, though, so maybe worth investigating. I think Rules was being refactored from the ground up for Drupal 8, so I figured we’d just wait until we’re on D8 to look at it again. I don’t know if a D7-\>D8 migration path is being worked on.

So in summary: Rules would make it really easy for advanced farmOS users (but not necessarily programmers) to configure triggered actions in the UI. But if you are comfortable with a bit of programming, writing a custom module to do exactly what you want might be simpler (and provide more options).

---

_[View the full topic](https://farmos.discourse.group/t/schedule-a-log-based-on-a-quantity-value/115)._
