Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


jnimocks
2022-04-12T15:32:37Z
Hello,

I have created a Job/Task Control task that I would like to run only on the last day of the month. If it is not the last day of the month the job should continue to the next task. I created a user variable to pull the last day of the month. I used this task with the condition of the Job/Task Control task but it appears the job is kicked off every time, regardless of the date.
Sponsor
Forum information
Gary_W
2022-04-12T16:06:46Z
Please update your post to include how you are arriving at the last day of the month. Seems a logical place to start troubleshooting. Including the settings for the condition would be next.
jnimocks
2022-04-13T13:09:05Z
To determine the last day of the month I create user variable (LastDayOfTheMonth). Within the task (Job/Task control) I create a condition to check this variable against today's date (Date). The test job is kick off every time, regardless of the date. Please see screen shots below.  condition.docx (20kb) downloaded 18 time(s).  Date.docx (32kb) downloaded 16 time(s).  LastDayOfTheMonth.docx (35kb) downloaded 18 time(s).  Task.docx (30kb) downloaded 17 time(s).
Gary_W
2022-04-13T15:09:28Z
First, make sure the condition is checked on the conditions tab of the task so it will be applied to the task.

If I'm reading things right, in the condition you are comparing {USERVAR(LastDayOfTheMonth)} (which is "4/30/2022") to a regular expression of "30".

Since you really want to compare today to {USERVAR(LastDayOfTheMonth)}, I believe you can simplify this by changing the condition to equal and set
value1 to {USERVAR(Date)} and Value2 to {USERVAR(LastDayOfTheMonth)}. Test by setting Value2 to "4/13/2022" to trigger last day of the month processing. This uses the date formats you have already in your user variables.

Using "regex-match" as the condition means using a regular expression in value2 to see if it matches value1. i.e. if "4/30/2022" were in value1 then a regular expression of "\d{1,2}/30/\d{4}" would match.
one but not more than 2 digits followed by a slash then then number 30 then a slash then 4 digits.
jnimocks
2022-04-14T14:29:25Z
Gary,
Thank you so much for your help! That worked!

Thanks again,
Jill
Gary_W
2022-04-14T14:36:55Z
Great, glad I could help.
Scroll to Top