how to set time to wait for in flow designer using data pill picker?

Varsha21
Giga Guru

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.

1 ACCEPTED SOLUTION

Hi, I made a simple flow to check - it is a "Duration".

Hope it helps

find_real_file.png

Hope it helps

View solution in original post

7 REPLIES 7

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.

GV Jan Moser
Giga Guru

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

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!