- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2021 03:43 AM
Hi Community,
I have a requirement to wait for some duration of time, e.g 4 hours.
but this 4 I am using in a property, and I want to pause my flow using this property for 4 hours.
for that, I want to use wait for action but don't know how to set that property time using a data pill picker.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2021 09:44 AM
Hi, I made a simple flow to check - it is a "Duration".
Hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 03:45 AM
Varsha - Did you manage to get the value from your system property into the wait action?
I have a similar issue and I don't know what type the sys property should be in. Currently I've set is as an integer and the value is 300000 but the wait is more or less instant indicating that it isn't working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2023 03:55 AM
I simply love when there are solutions that do not come with answer to the questions at all.
Correct answer from my point of view:
If you want to use dynamic value for "Wait for", you need to connect Flow variable that is in "Duration" format. And "Duration" format is simply date from 1/1/1970 in SN format: 1970-01-01 00:00:00.
Example:
Backend
1. Create sys property "my.duration".
2. Set the value of this property to value "1970-01-01 00:05:00". (5 minutes waiting)
Flow designer
3. Create Flow variable "My duration"
4. Insert action "Set flow variables" anywhere before your "Wait for" action, add "My duration" and set its value via script like this: return gs.getProperty("my.duration");
5. Update "Wait for" action by dragging the "My duration" pill over the "Wait for" input.
And this is it. Your flow will be now waiting amount of time that is stored in the sys property. You can change it anytime without touching the Flow itself 😉
Honorable mentions:
Servicenow counts the time of Duration since 1/1/1970 00:00:00 so if you want your Flow to be waiting, for example, for 10 days, simply set your sys property value to 1970-01-10 00:00:00.
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 11:19 AM
Hi @GV Jan Moser ,
What a shame, out of all the answers your answer is the most precise and works, but still neither was it marked as the correct answer, nor helpful (until I did).
Thanks, it helped me though!