2

Client is thinking about several date fields for a contact eg, when are they available to start volunteering' and want an alert for it. My presumption was 'oh let's do it with Activities' but actually I wondered if CiviRules could do this.

I ran a test and saw I can use Field value comparison, and set the field to 'is equal to' - but assume that NOW won't work out-of-the-box but happy to be told otherwise.

Assuming not, can you give me a pointer or know if this has been tried and is 'too hard basket'?

EDIT: so a custom field shows 'date i am available to volunteer' for a volunteer which will be sometime in the future. And the Admin want to get a reminder/notification say 5 days before that date is reached.

So I think the Linked Condition is eg Condition = Field value comparison, and Description is Contact.custom_127 = NOW

And Linked Action would be: Add Activity to Contact. Type: Email. Status:Scheduled. Subject: check availability. Assignee: Peter DavisFZ

BUT if it ends up needing to be an Activity then I can also think about creating it at the outset on the form.

Reason I wondered about CiviRules is that I though "ha, with civicrm entity I can probably trigger a notification directly via Drupal Rules", and then i remembered CiviRules and wanted to find out more of what it could do ;-)

  • Could you elaborate a bit more on your use case? A bit hard to understand? To ask in CiviRule-terms, do you want an alert (action), when some criterias are met(condition), but are not sure what should trigger it(trigger)? – Flying May 18 '16 at 8:40
  • Like Pete and Flying suggested, it helps if you explain a little more about what you are trying to achieve. There has been a fix for date comparison, not sure if it does NOW out of the box. But there might be other answers to if you explain a little more. – ErikH - CiviCooP May 18 '16 at 9:35
  • hope my edit helps – petednz - fuzion May 18 '16 at 9:46
  • Could you use - 1 day, instead of NOW? From your use case, I would think it would be better to be alarmed a couple of days before. And as @Alain Schaefer explains, he has developed functionality that can help with that already – Flying May 20 '16 at 4:56
  • yes. i am not attached to NOW at all. just from a drupal sense, if something copes with 'NOW' then it copes also with - 5 days etc. will give this a try soon as i can get back to it – petednz - fuzion May 20 '16 at 7:07
3

You are on the right track with using now in field comparision. See my Question and Answer here.

  • trigger: daily trigger for group members

  • condition: field value comparison for a date, datetime or timestamp field, where you can use any string recognized by the php function strtotime. So you should be able to use now as explained in the PHP documentation. In your case i would use "+5 days" as the comparison value.

After saving the condition the description should show Contact.custom_127 = 2016-05-19 (date when you saved the condition.)

Hint: use the latest CiviRules from Github, as support for timestamps was added a few days ago.

  • Alain - thanks so much for that information. I look forward to giving it work through soon. – petednz - fuzion May 19 '16 at 8:27
1

Normally, you need something to happen, so that you have something to react to.

But, there is two options for handling this differently.

1. Manually:

Tag a contact. If you have a CiviRule build with the trigger Contact is tagged, you could let CiviRules do anything you want, if you tag the contact.

2. Daily and automatically

To cover for the cases where there is no trigger actually happen. Like a contact that has NOT contributed for the last three months. Then the trigger could be "daily group check." (And the conditions of no contributions last three months). This is connected to a cron job, that runs once a day, and then "creates" the trigger action needed for a CiviRule to run.

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.