<?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 I wanna call script include value and set in business rule of custom  field value in Member Feedback forum</title>
    <link>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087222#M3453</link>
    <description>&lt;P&gt;scriptincludefunction: function(current) {&lt;/P&gt;&lt;DIV&gt;var groupId = gs.getProperty("group_user");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var test = new GlideRecord("sys_user_grmember");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test.addEncodedQuery("group=" + groupId);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test.query();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (test.next()) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (field1.indexOf(test.user.toString()) == -1 &amp;amp;&amp;amp; field2.user.toString().indexOf(requester) == -1) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (checking) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checking += ',' + test.user.toString();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checking = test.user.toString();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;I wanna&amp;nbsp; checking value to set on the business rule field that is list&amp;nbsp;&lt;BR /&gt;In Business rule syntax:-&lt;BR /&gt;var x = new scriptincludename();&lt;/DIV&gt;&lt;DIV&gt;u_field_name = x.scriptincludefunction(current.checking);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In script include checking values should be set u_field_name&amp;nbsp;&lt;BR /&gt;Please help me to how to write syntax on BR to get value from script include&lt;/DIV&gt;&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2024 02:43:51 GMT</pubDate>
    <dc:creator>Anish9515</dc:creator>
    <dc:date>2024-10-29T02:43:51Z</dc:date>
    <item>
      <title>I wanna call script include value and set in business rule of custom  field value</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087222#M3453</link>
      <description>&lt;P&gt;scriptincludefunction: function(current) {&lt;/P&gt;&lt;DIV&gt;var groupId = gs.getProperty("group_user");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var test = new GlideRecord("sys_user_grmember");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test.addEncodedQuery("group=" + groupId);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test.query();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (test.next()) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (field1.indexOf(test.user.toString()) == -1 &amp;amp;&amp;amp; field2.user.toString().indexOf(requester) == -1) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (checking) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checking += ',' + test.user.toString();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; checking = test.user.toString();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;I wanna&amp;nbsp; checking value to set on the business rule field that is list&amp;nbsp;&lt;BR /&gt;In Business rule syntax:-&lt;BR /&gt;var x = new scriptincludename();&lt;/DIV&gt;&lt;DIV&gt;u_field_name = x.scriptincludefunction(current.checking);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In script include checking values should be set u_field_name&amp;nbsp;&lt;BR /&gt;Please help me to how to write syntax on BR to get value from script include&lt;/DIV&gt;&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 02:43:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087222#M3453</guid>
      <dc:creator>Anish9515</dc:creator>
      <dc:date>2024-10-29T02:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: I wanna call script include value and set in business rule of custom  field value</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087537#M3457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/217546"&gt;@Anish9515&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;You need to add a return statement.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;scriptincludefunction: function(current) {

var groupId = gs.getProperty("group_user");
        var test = new GlideRecord("sys_user_grmember");
        test.addEncodedQuery("group=" + groupId);
        test.query();
 
        while (test.next()) {
            if (field1.indexOf(test.user.toString()) == -1 &amp;amp;&amp;amp; field2.user.toString().indexOf(requester) == -1) {
                if (checking) {
                    checking += ',' + test.user.toString();
                } else {
                    checking = test.user.toString();
                  }
              }
         }

       return checking;

}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;And write the business rule, with conditions Before Insert/Update.&lt;BR /&gt;&lt;BR /&gt;u_field_name = new scriptincludename().scriptIncludefunction();&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If the above information helps you, Kindly mark it as Helpful and Accept the solution.&lt;BR /&gt;Regards,&lt;BR /&gt;Najmuddin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 03:12:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087537#M3457</guid>
      <dc:creator>Najmuddin Mohd</dc:creator>
      <dc:date>2024-10-29T03:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: I wanna call script include value and set in business rule of custom  field value</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087565#M3458</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/217546"&gt;@Anish9515&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like there might be a few points of confusion in your script. Here are some areas to review:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The parameter &lt;STRONG&gt;current&lt;/STRONG&gt; is defined but never used in the function.&lt;/LI&gt;&lt;LI&gt;Variables &lt;STRONG&gt;field1&lt;/STRONG&gt; and &lt;STRONG&gt;field2&lt;/STRONG&gt; are called, but it’s unclear where they’re defined.&lt;/LI&gt;&lt;LI&gt;The &lt;STRONG&gt;requester&lt;/STRONG&gt; variable also appears to be missing a definition.&lt;/LI&gt;&lt;LI&gt;There's no &lt;STRONG&gt;checking&lt;/STRONG&gt; variable defined before it's used&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Could you provide more details on what you’re aiming to accomplish with this code?&amp;nbsp;It’ll help us offer more precise guidance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Tai Vu&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 03:51:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3087565#M3458</guid>
      <dc:creator>Tai Vu</dc:creator>
      <dc:date>2024-10-29T03:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: I wanna call script include value and set in business rule of custom  field value</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3089309#M3462</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/504424"&gt;@Najmuddin Mohd&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Using logs I have noticed , checking has sysid's , How to return those sysyid in script include&lt;BR /&gt;My custom field type is "LIST" , How to set those sysid&lt;BR /&gt;your syntax is working but how to set those sysid&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 17:47:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-wanna-call-script-include-value-and-set-in-business-rule-of/m-p/3089309#M3462</guid>
      <dc:creator>Anish9515</dc:creator>
      <dc:date>2024-10-29T17:47:31Z</dc:date>
    </item>
  </channel>
</rss>

