
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 10:17 AM
I'm creating a Flow Designer custom action to find dates I might need and the third output is going to be the next weekday however I cannot get the addDaysUTC or addDaysLocal or addDays function to create an output.
- Confirmed that if I only try to make output.next_weekday = todaysdatetime; the output is the correct date & time.
- I also tried monday.getDate(); with no output
- NOTE: First two outputs work as expected
(function execute(inputs, outputs) {
//Output the current date (glide_date)
var todaysdatetime = new GlideDateTime();
outputs.today_datetime = todaysdatetime;
outputs.today_date = new GlideDate();
//gets current day of the week
var present = new Date();
var day = present.getDay();
//if (day == 5) {
var monday = todaysdatetime.addDaysUTC(2);
outputs.next_weekday = monday;
//}
})(inputs, outputs);
Solved! Go to Solution.
Labels:
- Labels:
-
Scripting and Coding
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 10:50 AM
Found my own answer but I'm posting here because I couldn't find answer when I looked. Should have been.
todaysdatetime.addDaysUTC(2)
var monday = todaysdatetime.getValue();
outputs.next_weekday = monday;
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 10:50 AM
Found my own answer but I'm posting here because I couldn't find answer when I looked. Should have been.
todaysdatetime.addDaysUTC(2)
var monday = todaysdatetime.getValue();
outputs.next_weekday = monday;