- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:07 AM
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:
In this case I'm grabbing the variable from a system property in an earlier action.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:19 AM
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:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:44 AM
Thank you OlaN.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 01:13 AM - edited 11-08-2024 01:14 AM
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.