Pass variable into relative date/time condition in flow

Jamsta1912
Tera Guru

Hi all,

In a flow, is it possible to pass in a variable to a record condition based on date/time, using the 'relative' operator? i.e. here:

find_real_file.png

In this case I'm grabbing the variable from a system property in an earlier action.

Thanks

 

1 ACCEPTED SOLUTION

OlaN
Giga Sage
Giga Sage

Hi,

Haven't tried it, but with the "relative" I believe no, not possible.
Then you would probably need to script the condition.

As an alternate, you could use "at or after" and combine with the data pill picker, like below:

find_real_file.png

View solution in original post

3 REPLIES 3

OlaN
Giga Sage
Giga Sage

Hi,

Haven't tried it, but with the "relative" I believe no, not possible.
Then you would probably need to script the condition.

As an alternate, you could use "at or after" and combine with the data pill picker, like below:

find_real_file.png

Thank you OlaN. 

emaasalmi
Kilo Sage

Having the same question, I came across this post. I understand that this is an old post and not relevant anymore, but

I wanted to correct the accepted solution by showing, that it is indeed possible to pass a variable to a relative date/time condition in Flow designer.

 

Example:

A relative condition for "Created - relative - before - 10 Days ago" comes to the following encoded query:

 

 

"sys_created_onRELATIVELT@dayofweek@ago@10"

 

 

whereas a relative condition where "before"/"after", number of Minutes/Hours.. and "ago"/"from now" are left empty comes to an incomplete encoded query of:

 

 

"sys_created_onRELATIVE"

 

 

Comparing these, all you need to do is to complete the the encoded query.

So using the original example where we wanted to look up records created before 10 days ago, you would need to complete the encoded query with the following string:

 

 

"LT@dayofweek@ago@10"

 

 

The system then combines the condition builder selection + your string: 

 

 

"sys_created_onRELATIVE" + "LT@dayofweek@ago@10"

 

 

which, as you can see, ends up being the same encoded query as the one used by the system when the values were selected in the condition builder.

I used one Flow variable "days_ago" to set the number of days dynamically, and then another Flow variable with a script to set the encoded query string. Example resolution in the attachment.

dynamic_relative_condition.png