<?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 Advanced reference qualifer in ServiceNow AI Platform forum</title>
    <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073381#M29770</link>
    <description>&lt;P&gt;I am looking to make an advanced reference qualifier for a user reference field. &amp;nbsp; I want it so when a this field is selected, only certain members from a group show up. &amp;nbsp; What would the script method be?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2016 14:10:21 GMT</pubDate>
    <dc:creator>josh_brostoff</dc:creator>
    <dc:date>2016-02-04T14:10:21Z</dc:date>
    <item>
      <title>Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073381#M29770</link>
      <description>&lt;P&gt;I am looking to make an advanced reference qualifier for a user reference field. &amp;nbsp; I want it so when a this field is selected, only certain members from a group show up. &amp;nbsp; What would the script method be?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:10:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073381#M29770</guid>
      <dc:creator>josh_brostoff</dc:creator>
      <dc:date>2016-02-04T14:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073382#M29771</link>
      <description>&lt;P&gt;I tried the following but it didn't work:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; javascript:gs.getUser().isMemberOf('insert group name here');&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:13:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073382#M29771</guid>
      <dc:creator>josh_brostoff</dc:creator>
      <dc:date>2016-02-04T14:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073383#M29772</link>
      <description>&lt;P&gt;This would be a little more complex than that. The reference qualifier is basically a query you're running against the user table, so it has to be formatted in that way. What you'd need to do is write a simple script include that queried the sys_user_grmember table and returned a comma separated list of user sys_ids. You would return something like 'sys_idIN' + listOfSysIDs&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:25:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073383#M29772</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2016-02-04T14:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073384#M29773</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You need to write your own custom script include. I have just created one. Below is the code.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;--&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var GroupUtil = Class.create();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;GroupUtil.prototype = {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; initialize: function() {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; memberofGroup: &amp;nbsp; function(){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var users=[];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var grp = new GlideRecord('sys_user_grmember');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; grp.addQuery('group','1c590685c0a8018b2a473a7159ff5d9a');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; grp.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; while(grp.next()) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; users.push(grp.getValue('user'));&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; gs.addInfoMessage('sysIDIN'+users.join(','));&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; return 'sys_idIN'+users.join(',');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; },&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: 'GroupUtil'&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;};&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;---&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Here is the screen&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-02-04 at 7.54.05 PM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/114605i90B667E1C45535F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2016-02-04 at 7.54.05 PM.png" alt="Screen Shot 2016-02-04 at 7.54.05 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You need to call this from ref qualifier.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;javascript:new GroupUtil().memberofGroup()&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:26:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073384#M29773</guid>
      <dc:creator>srinivasthelu</dc:creator>
      <dc:date>2016-02-04T14:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073385#M29774</link>
      <description>&lt;P&gt;This looks perfect, Srini! My only question is: could this already exist somewhere by default? I didn't find anything when looking through the baseline Script Includes, but it seems like it would be a common use case that might already be addressed.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:52:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073385#M29774</guid>
      <dc:creator>Mike McCall</dc:creator>
      <dc:date>2016-02-04T14:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073386#M29775</link>
      <description>&lt;P&gt;Thanks, Srini! This worked!&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 15:00:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073386#M29775</guid>
      <dc:creator>josh_brostoff</dc:creator>
      <dc:date>2016-02-04T15:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced reference qualifer</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073387#M29776</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Guess what, I have also searched for such oob utility when i saw this question. Could not find one, so just wrote it.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 15:23:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/advanced-reference-qualifer/m-p/1073387#M29776</guid>
      <dc:creator>srinivasthelu</dc:creator>
      <dc:date>2016-02-04T15:23:46Z</dc:date>
    </item>
  </channel>
</rss>

