im making an full automated task management application
and im trying to make a workflow that if a case have an active service attached to it lets say with an interval of every year.. but could also be an interval for every month or every week.. that there should automaticaly get created a repeated task for that case for each interval..
i already have maked the backend API workflow there should do that.. but i cant find the logic in the condition for how to execute that.. both because the intervals are different but also because a case could contain different services with different intervals..
a service contains these fields:
titel
interval
next date
status
and value
and if the next date is lets say May 2026 i want it to automaticaly create a task 30 days before that next date..
but also if the interval is every month and next date is june 2025 i want it to automaticaly create the task 7 days before
hope there is someone out there with a better logic than me there could help with getting this to work
you can schedule backend workflows and when setting the scheduled date use the built in operators of +days, +weeks etc. , so that your expression could be something like current date/time +days7
but doesnt that just do so that it plans it 7 days forward for current date?
i want it to plan 7 days before the service next date field if it is an interval pr month.. but 30 days before the service next date field if it a yearly interval for the service.. and 2 days before if its a weekly interval.. and so on
do i then just make a wokflow “if condition is true” and set the conditon when service interval is yearly ? and then set schedule to service next date's +days -30
and then make a workflow for each interval?
will that be the right way to do it?
But a better way, if you’re using an option set like I suggested, is just to schedule the workflow dynamically to the Next Date +Days [the dynamic value of the Option Set lead-in attribute] (i.e. 7 Days)
That way you don’t need to use any conditions, and can just use a single workflow.
i already have the intervals as option sets..
but do you mean to then make the action of schedule the API worflow in the create of the service workflow?
as you see here (its on danish tho) but its different intervals for
one time
every week
every 14 days
every month
every second month
every quarter
every half year
and every year