Creation of a trigger for prepayments based on the bookyear via formula

Hi,

We’re looking into some ways on how to use the Insights functionality.

One of the ideas is to have an automated (daily) trigger that notifies our team members that specific prepayment deadlines are coming. There’s already some predefined segmentation in the app that defines “companies in a payable position”, but this would not fit our usecase.

We were wondering if it would also be possible to define triggers based on more complex logic / dynamic segments that change in relation to the current date.

Eg:
“Make a notification 2 weeks before a prepayment deadline comes up, which is end of bookyear - 2 months”.

“Make a todo 8 weeks before filing deadline, for all companies which do not yet have a trial balance uploaded.”

Any ideas on how to tackle these usecases?

1 Like

Hi there,

You could create a template with variables that contain the current date, the deadline date and the difference between these two, for example:

{% assign current_date = "now" | date:"%d/%m/%Y"  %}
{% input custom.deadline.prepayments as:date assign:deadline_date %}
{% assign date_difference = deadline_date-current_date | integer %}

In this case the date_difference will return the difference in days so you can create a segment in your insights that searches for clients with a date_difference <= 14 (if the deadline is within 2 weeks)

First we store this difference in a result tag in our template (to be able to use it later on insights):

{% result 'date_difference' date_difference %}

Then we go to insights and create a segment with the following filter:

image

Once we save this segment, we will be able to create a trigger that notifies certain users on a daily basis for the specific clients that meet the above criteria:

I hope that helps.

Best,
Borja

1 Like

Sounds great, will the variable be updated in the background, or does it require user interaction before it’s updated?

(I thought templates would only recalculate if a user opens them, or they receive a ping from another updated template)

Hi,

The variable will be updated automatically if you include a workflow filter on your segment, like this:

image

This makes the filter refresh all clients matching the criteria so it can take a while to load but should work fine.

Best,
Borja

2 Likes

Thanks, this should do the trick then :slight_smile:

1 Like

Hi Borja,

I was wokring on creating a similar to trigger to send out notification based on upcoming dates. Is there any restrictions on how many triggers could be run using the same segment? As it appears that when a trigger is run and the note is sent out re-running the same trigger is not sending out a note unless the original note is deleted.

Is this the expected function of a trigger? I guess this should work if there no changes to the date are made but looks like if there is a change to the deadline date would an updated trigger note wouldn’t be sent out unless the original note is removed.

Please let me know.

Thanks,

Dominic

Hi Dominic,

I don’t think there a specific limitation on the number of triggers you can use.
The triggers can be run either manually (the note will be sent when the condition is met) or daily (the note will be sent out every day as long as the condition is still met).

Are you using the “run once” button? If so, the note should be sent once you press it if the condition is met and if the note has not already been run on that day (you can’t run the same trigger more than once on the same day).

For more information regarding triggers please take a look at the following link:

Best,
Borja

Thanks Borja for the info.

I did both first ran the trigger “daily” the first time it worked but was testing out again and the note didn’t go out. So tired running the same trigger manually but no new note was send out. So thought maybe need to remove the original note and tried again to run the trigger manually a new note got sent out.

For e.g. I ran it the below trigger once first manually and the note got posted.

image

I try to rerun the trigger manually no new not got posted. I try to change the body of the note as well. But once I remove the above note and ran the trigger manually again the new note got sent.

image

Is how the trigger would work? where it won’t send out new notes for the same trigger multiple times?

Thanks,

Dominic

Hi @dominic,

The trigger will only re-send a note if we change the condition of the segment on that particular period (e.g. the workflow completion goes from 50% to 100%) or if the note that was sent is removed. The reason behind this is that we don’t want to keep sending notifications to the user on a daily basis unless there is a change in the initial filters.

You could create then different triggers for different dates which is I guess what you are trying to achieve.

Best,
Borja

1 Like

Perfect thanks for the confirmation. I play around with the segments to achieve what we trying to do. Thanks again for prompt response.

Dominic