<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A question regarding fromTime and toTime Condition, Please help.</title><link>https://community.appian.com/discussions/f/general/20485/a-question-regarding-fromtime-and-totime-condition-please-help</link><description>Hi 
 Let&amp;#39;s see I have a filter, it gives you fromTime and endTime. 
 and I have 4 time point which is: 00:00, 9:00, 13:00, 17:00 
 The text number I give to those block as &amp;quot;00&amp;quot;,&amp;quot;09&amp;quot;,&amp;quot;13&amp;quot;,&amp;quot;17&amp;quot;, 
 
 now, base on the filter&amp;#39;s fromTime and endTime, if my</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: A question regarding fromTime and toTime Condition, Please help.</title><link>https://community.appian.com/thread/79888?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 17:55:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a4ae1bc-d376-40c8-99d4-599bda2621b4</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Great! :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A question regarding fromTime and toTime Condition, Please help.</title><link>https://community.appian.com/thread/79887?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 17:51:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0e11f879-c33b-42c0-9f93-a99f61547ce9</guid><dc:creator>Peiran Liu</dc:creator><description>&lt;p&gt;This is amazing and worked!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you Chris!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A question regarding fromTime and toTime Condition, Please help.</title><link>https://community.appian.com/thread/79886?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 17:35:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:476cb8a3-150a-4292-81e7-beab43128614</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Here&amp;#39;s an example that takes in a list of time points (0,9,13,17) and loops through a dictionary list of from/to times.&amp;nbsp; You will check if the time point is after the fromTime, and either end time is null or end time is after the time point.&amp;nbsp; This should get you going:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!times: {
    time(0,0,0),
    time(9,0,0),
    time(13,0,0),
    time(17,0,0)
  },
  local!ranges: {
    {fromTime: time(7,0,0), toTime: null},
    {fromTime: time(9,20,0), toTime: time(13,20,0)}
  },
  
  a!forEach(
    items: local!ranges,
    expression: {
      a!localVariables(
        local!currentRange: fv!item,
        reject(
          fn!isnull,
          a!forEach(
            items: local!times,
            expression: {
              if(
                and(
                  fv!item&amp;gt;totime(local!currentRange.fromTime),
                  or(
                    fn!isnull(local!currentRange.toTime),
                    totime(local!currentRange.toTime)&amp;gt;fv!item
                  )
                ),
                substitute(padleft(hour(fv!item),2),&amp;quot; &amp;quot;,0),
                null
              )
            }
          )
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>