<?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 Applying query on for Script Include in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140612#M1169181</link>
    <description>&lt;P&gt;I want to apply the encoded&amp;nbsp; or addQuery to script, The script is targeting the HRprofile table, ask is-&lt;/P&gt;&lt;P&gt;If Hr Profile has not been inactive from last 90 days before the employment start date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employment start date is a custom field on HR Profile table.&lt;/P&gt;&lt;P&gt;I tried using this query ;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 502px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410769i1FD7539E7EADA59B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 17:28:53 GMT</pubDate>
    <dc:creator>SUser1234</dc:creator>
    <dc:date>2025-01-03T17:28:53Z</dc:date>
    <item>
      <title>Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140612#M1169181</link>
      <description>&lt;P&gt;I want to apply the encoded&amp;nbsp; or addQuery to script, The script is targeting the HRprofile table, ask is-&lt;/P&gt;&lt;P&gt;If Hr Profile has not been inactive from last 90 days before the employment start date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employment start date is a custom field on HR Profile table.&lt;/P&gt;&lt;P&gt;I tried using this query ;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 502px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410769i1FD7539E7EADA59B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 17:28:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140612#M1169181</guid>
      <dc:creator>SUser1234</dc:creator>
      <dc:date>2025-01-03T17:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140616#M1169184</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/821783"&gt;@SUser1234&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you have to use encoded query for this . Test it in Hr profile list view check valid records you are getting then use it in script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;grProfile.addEncodedQuery(&lt;/SPAN&gt;&lt;SPAN&gt;'employment_start_dateRELATIVELE@dayofweek@ago@90'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If my response helped, please mark it as the accepted solution &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and give a thumbs up&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;BR /&gt;Thanks,&lt;BR /&gt;Anand&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 17:45:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140616#M1169184</guid>
      <dc:creator>Anand Kumar P</dc:creator>
      <dc:date>2025-01-03T17:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140627#M1169190</link>
      <description>&lt;P&gt;But how are we comparing to last login?&lt;/P&gt;&lt;P&gt;I mean not inactive&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 17:48:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140627#M1169190</guid>
      <dc:creator>SUser1234</dc:creator>
      <dc:date>2025-01-03T17:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140655#M1169195</link>
      <description>&lt;P&gt;if you want active then add&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;grProfile.addEncodedQuery(&lt;/SPAN&gt;&lt;SPAN&gt;'active=true^employment_start_dateRELATIVELE@dayofweek@ago@90'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 18:41:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140655#M1169195</guid>
      <dc:creator>Anand Kumar P</dc:creator>
      <dc:date>2025-01-03T18:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140666#M1169199</link>
      <description>&lt;P&gt;I am talking about if user is not inactive from last 90 days before the employment start date&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 19:01:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140666#M1169199</guid>
      <dc:creator>SUser1234</dc:creator>
      <dc:date>2025-01-03T19:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140679#M1169204</link>
      <description>&lt;P&gt;you can get last login time in user table to compare the date.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 19:34:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140679#M1169204</guid>
      <dc:creator>ashishdevsingh</dc:creator>
      <dc:date>2025-01-03T19:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140794#M1169226</link>
      <description>&lt;P&gt;Please rephrase this - "&lt;SPAN&gt;I am talking about if user is not inactive from last 90 days before the employment start date"&lt;BR /&gt;&lt;BR /&gt;Do you mean users that have started within that last 90 days?&amp;nbsp;&lt;BR /&gt;Do you mean users that are currently active (hired), but were de-activated within the last 90 days? This would refer to the wait period after leaving a contingent worker position, before they can start again.&lt;BR /&gt;Something else?&lt;BR /&gt;&lt;BR /&gt;It's not perfectly clear what you're asking.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 01:06:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140794#M1169226</guid>
      <dc:creator>jaycoover</dc:creator>
      <dc:date>2025-01-04T01:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140801#M1169228</link>
      <description>&lt;P&gt;Is something like this helpful?&lt;BR /&gt;employment_start_dateMORETHANemployment_end_date@day@before@90&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 01:48:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140801#M1169228</guid>
      <dc:creator>jaycoover</dc:creator>
      <dc:date>2025-01-04T01:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Applying query on for Script Include</title>
      <link>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140971#M1169268</link>
      <description>&lt;P&gt;Try a Database view linking sh_hr_core_profile to sys_user, and compare 'employment_start_date' to 'last_login_time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-01-04 095912.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410875i834DFAE49C2C7571/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-01-04 095912.png" alt="Screenshot 2025-01-04 095912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;set view fields as desired, I created the above in the 'Human Resources: Core' application scope.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 15:01:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/applying-query-on-for-script-include/m-p/3140971#M1169268</guid>
      <dc:creator>Bert_c1</dc:creator>
      <dc:date>2025-01-04T15:01:54Z</dc:date>
    </item>
  </channel>
</rss>

