The flow designer has to trigger every 180 days

Mounika M
Tera Contributor

Hi All,

We have flow designer it has to triggers for every 180 days on july 1st, when I am giving trigger condition as repeat 180 days, it is not visible on schedule list. could anyone please help on this.

Regards

Mounika

6 REPLIES 6

Julian25
Tera Contributor

Thanks for this, if I were to set this to run monthly would you have an example you could share of the custom script that I would need to use ?

Yes sure, in the article I mentioned earlier the goal is to create a custom action that evaluates if the day is the correct day. So similar to that, you can create a custom action to evaluate if the month is correct or not.

In the below example I've hardcoded the evaluation in the script, but a better and more generic solution would be to send the desired month (number) as input to the custom action.

I'm sure you get the general idea.

(function execute(inputs, outputs) {
  if (inputs.indate) {
  var tempDate = inputs.indate
  var gdt = new GlideDateTime(tempDate);
  if (gdt.getMonthUTC() == 3) {  // the number of the month you want to find
    outputs.correctmonth = true
  }
  else
    outputs.correctmonth = false;
  }
  else
    outputs.correctmonth = false;
})(inputs, outputs);