<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question ServiceNow Workflow Activity in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139306#M1168776</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to run an activity in ServiceNow workflow once time mentioned by the requester in the ticket in variable (&lt;SPAN&gt;Time and Date to remove access&lt;/SPAN&gt;) is passed.&lt;/P&gt;&lt;P&gt;Which activity i have to use and how to compare that time with current time. Please guide. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 11:38:06 GMT</pubDate>
    <dc:creator>Nikita50</dc:creator>
    <dc:date>2025-01-02T11:38:06Z</dc:date>
    <item>
      <title>ServiceNow Workflow Activity</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139306#M1168776</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to run an activity in ServiceNow workflow once time mentioned by the requester in the ticket in variable (&lt;SPAN&gt;Time and Date to remove access&lt;/SPAN&gt;) is passed.&lt;/P&gt;&lt;P&gt;Which activity i have to use and how to compare that time with current time. Please guide. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 11:38:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139306#M1168776</guid>
      <dc:creator>Nikita50</dc:creator>
      <dc:date>2025-01-02T11:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceNow Workflow Activity</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139311#M1168779</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/426300"&gt;@Nikita50&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How and where you are capturing the time ? is it in variables? then get the variable and compare with current date and time.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 11:46:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139311#M1168779</guid>
      <dc:creator>Dr Atul G- LNG</dc:creator>
      <dc:date>2025-01-02T11:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceNow Workflow Activity</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139318#M1168783</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/426300"&gt;@Nikita50&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you can use Wait for condition activity with script as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var currentTime = new GlideDateTime();
var varTime = new GlideDateTime('2025-01-02 11:46:00');
if(varTime.compareTo(currentTime)&amp;lt;=0)
	answer=true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;replace varTime = new GlideDateTime(current.variables.dateTimeVar_name&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please mark my answer as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#008000"&gt;helpful/correct&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;if it resolves your query.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Regards,&lt;BR /&gt;Chaitanya&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 12:05:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139318#M1168783</guid>
      <dc:creator>Chaitanya ILCR</dc:creator>
      <dc:date>2025-01-02T12:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceNow Workflow Activity</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139319#M1168784</link>
      <description>&lt;P&gt;Hi AG,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, date is provided in a date an time variable (Catalog variable)&lt;/P&gt;&lt;PRE&gt;(function executeRule(current, previous /*null when async*/) {
    var requestedTime = current.variables.requested_time; // Replace with your variable name
    var currentTime = new GlideDateTime();

    // Convert requested time to GlideDateTime
    var requestedDateTime = new GlideDateTime(requestedTime);

    // Check if current time is greater than or equal to requested time
    if (currentTime.compareTo(requestedDateTime) &amp;gt;= 0) {
        return true; // Condition met
    } else {
        return false; // Condition not met
    }
})(current, previous);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I am using this script but it is stuck in running even when time is passed.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 11:54:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139319#M1168784</guid>
      <dc:creator>Nikita50</dc:creator>
      <dc:date>2025-01-02T11:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceNow Workflow Activity</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139322#M1168787</link>
      <description>&lt;P&gt;Hi Chaitanya,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, date is provided in a date an time variable (Catalog variable)&lt;/P&gt;&lt;PRE&gt;(function executeRule(current, previous /*null when async*/) {
    var requestedTime = current.variables.requested_time; // Replace with your variable name
    var currentTime = new GlideDateTime();

    // Convert requested time to GlideDateTime
    var requestedDateTime = new GlideDateTime(requestedTime);

    // Check if current time is greater than or equal to requested time
    if (currentTime.compareTo(requestedDateTime) &amp;gt;= 0) {
        return true; // Condition met
    } else {
        return false; // Condition not met
    }
})(current, previous);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I am using this script but it is stuck in running even when time is passed.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 11:55:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139322#M1168787</guid>
      <dc:creator>Nikita50</dc:creator>
      <dc:date>2025-01-02T11:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceNow Workflow Activity</title>
      <link>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139339#M1168790</link>
      <description>&lt;P&gt;isn't this is a BR ?&lt;BR /&gt;you should add the script in the wait for condition script of the workflow&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChaitanyaILCR_0-1735819698783.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410489i0E7DB1C074BD40B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChaitanyaILCR_0-1735819698783.png" alt="ChaitanyaILCR_0-1735819698783.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please mark my answer as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#008000"&gt;helpful/correct&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;if it resolves your query.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Regards,&lt;BR /&gt;Chaitanya&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 12:08:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/servicenow-workflow-activity/m-p/3139339#M1168790</guid>
      <dc:creator>Chaitanya ILCR</dc:creator>
      <dc:date>2025-01-02T12:08:44Z</dc:date>
    </item>
  </channel>
</rss>

