- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 02:41 AM
Hi there
I have a catalog item with a DateTime variable.
i have also created custom action
(function execute(inputs, outputs) {
// ... code ...
var currentdate = gs.nowDateTime();
outputs.result = currentdate;
})(inputs, output
when i compare the 2 dates i get this error using the If condition in flow designer
if 'result' is at or after the ' catalog item datatime variable)''
Flow Designer: Operation(LucidChart.If$1.evalConditions) failed with error: com.snc.process_flow.exception.OpException: unable to evaluate condition for /if/_0_2394934e1b75a510e4a8cbb9274bcb96 = 27/03/2023 21:32:05 was not a datetime in format (ParseCaseSensitive(false)(Value(Year,4,10,EXCEEDS_PAD)'-'Value(MonthOfYear,2)'-'Value(DayOfMonth,2))'T'(Value(HourOfDay,2)':'Value(MinuteOfHour,2)[':'Value(SecondOfMinute,2)[Fraction(NanoOfSecond,0,9,DecimalPoint)]]))[Offset(+HH:MM:ss,'Z')['['ParseCaseSensitive(true)ZoneRegionId()']']]
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 02:30 AM
Change script as below.
(function execute(inputs, outputs) {
var accStartDate=inputs.RequiredDate;
var currentDate=new GlideDate();
//gs.log('accStartDate'+accStartDate);
//gs.log('currentDate'+currentDate);
// var compareDate=accStartDate.compareTo(currentDate);
// gs.log('compareDate'+compareDate);
if(accStartDate<=currentDate){
outputs.result=true;
}else{
outputs.result=false;
}
})(inputs, outputs);
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 11:08 PM
Have you created output variable and adding output to that variable? In action go to outputs menu and add the screenshot of that.
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 11:45 PM
i have only tested it in the 'action' not added to flow yet.
screenshot of test as per above
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 12:05 AM
I have created same action with complete inputs and outputs. It was working good. Find attachments for reference.
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 01:51 AM
Thanks so much Gopi
just one thing should not this be true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 01:54 AM
Log the ComparedDate value and Check what it is for your test case.
Thanks,
Gopi