Using script giving condition to wait for condition action in flow designer

Venky Kshatriy2
Tera Contributor

Hi Team,

 

Using the script  I am given condition to wait for condition action , below script i am used

var date = new GlideDate();


var vk =fd_data.trigger.request_item.variables.end_date.getValue();

if(vk<=date){
    return true;
}else{
    return false;
}
 
 But i am facing issue"class java.lang.Boolean cannot be cast to class java.lang.String (java.lang.Boolean and java.lang.String are in module java.base of loader 'bootstrap') in flow designer
 
If I used instead of return true , answer = true error not coming but scenario is not working. If any one knows abt this issue could pls help me on this
 
Advance thanks,
Team.
 
1 REPLY 1

Eshwar Reddy
Kilo Sage

Hi @Venky Kshatriy2 

Try Below Script

var currentDate = new GlideDateTime(); 
var endDateValue = fd_data.trigger.request_item.variables.end_date.getValue();
var endDate = new GlideDateTime(endDateValue); 
if (endDate <= currentDate) {
return true; 
} else {
return false; 
}

Thank you 
Esh