What format to use in a sys property to pass it to Wait For of the Flow Sub ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 06:02 AM
Hi,
I try to pass the value of my system property to the "Wait for" value of this subflow :
Data Pill Picker "Wait for" accepts the data type "Duration" but I don't know in which format to write it in my sys property ?
Here is the script of my action "Get System Property" :
I try to use the example with the GlideDuration class : https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/c_GlideDurationScopedAPI
By setting my sys property string value at : 60000
And I get this error when launching the flow :
Does anyone have an idea of the format I should use in my sys property or an example?
Regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 07:26 AM
Hello,
Pass the value in seconds.
Don't convert the value in duration.
Use parseInt in the script action.
Regards,
Nayan Awadhiya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 08:30 AM
Hello,
Thank you for your answer.
I have changed the configuration of the Sys Property at 10 seconds :
And modify my script action :
And I tested with two different configurations, an output type set to "Duration" and "Integer" and I get this result when I test the flow:
The correct result should be :
Here is a test done with the selector :
Do you have an idea why do I get "NaN" in the flow response?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 01:32 PM
To use a data pill for a 'Wait for' value in a Flow it has to be a data pill of variable type 'Duration'. So when you create your action make sure to return a Duration variable. Now what format goes into the Duration you ask? A string, but not just any string. It must be a date formatted string expressed as the amount of time from the date "1970-01-01 00:00:00". This date, January 1, 1970 is known as the epoch date, and is is used on all Linux based systems as a reference to measure system time.
Here is an example how to create the Set-Duration Action below. The Action has 3 inputs: hours, minutes, and days respectively:
//Example of the Script Step:
Now your output 'value' of type Duration data pill can be selected and placed into your 'Wait For' activity as an Explicit Duration.