How to set due date in Ask for approval action in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 04:45 AM - edited 04-25-2023 04:48 AM
Can anyone suggest how to set due date for ask for approval in flow designer without auto-approve auto-reject or auto-cancel? I tried with adding calculate catalog task due date action but getting one error
class com.glide.glideobject.GlideDateTime cannot be cast to class java.lang.String (com.glide.glideobject.GlideDateTime is in unnamed module of loader com.snc.orbit.container.tomcat8.Tomcat8$OrbitTomcat8ClassLoader @ae40e9; java.lang.String is in module java.base of loader 'bootstrap')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 09:21 AM
@mickydash2001 Will it be possible for you to share the snapshot of your flow here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 09:30 AM
This is the script I wrote
var gdt = new GlideDateTime();
gdt.addDaysUTC(2);
return gdt;
I tried with this too
var gdt = new GlideDateTime();
var time=gdt.toString();
time=time.split(' ');
gdt.addDaysUTC(2);
var gdt1=new GlideDateTime(gdt.getDate()+' '+time[1]);
return gdt1;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 09:39 AM
I am not sure about the context of this script however if you would like to get the date value in string then do it as follows.
var gdt = new GlideDateTime();
gdt.addDaysUTC(2);
return gdt.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 10:06 AM
I tried with this not getting any error here but the due date field is showing empty
So the context is I want to set the due date to 2 days from the current date but after 2 days also the approval should show requested it shouldn't auto approve or auto reject. Here is my flow and the error