<?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 Display help text conditionally in service portal in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518883#M90662</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need to expand (alternatively display) the help text on variable A, when variable A has value X, and preferably also revert back when not true. I found this article:&lt;/P&gt;
&lt;P&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=7a24c329dbd8dbc01dcaf3231f9619c3&amp;amp;view_source=searchResult&lt;/P&gt;
&lt;P&gt;but I can't seem to get it to work. Do I need to change some bit, since I need it for Service Portal UI?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or has something changed since, it's a 2 yr old post?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I got from this post, please tell me what is wrong here:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading) {
     if (isLoading || newValue == '') {
           return;
     }


     //Type appropriate comment here, and begin script below

var val =g_form.getValue('A');
if(val == 'X'){
 
var elems = document.getElementsByClassName('sc-help-text annotation-wrapper');
   for (var i=0;i&amp;lt;elems.length;i+=1){
 
   if (elems[i].style.display === 'none') {
   elems[i].style.display = 'block';
   }
 
   }
}
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or maybe nothing is wrong with my script, but something else I'm completely missing..&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;Annika&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2019 13:27:49 GMT</pubDate>
    <dc:creator>Annika Aaltonen</dc:creator>
    <dc:date>2019-05-20T13:27:49Z</dc:date>
    <item>
      <title>Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518883#M90662</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need to expand (alternatively display) the help text on variable A, when variable A has value X, and preferably also revert back when not true. I found this article:&lt;/P&gt;
&lt;P&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=7a24c329dbd8dbc01dcaf3231f9619c3&amp;amp;view_source=searchResult&lt;/P&gt;
&lt;P&gt;but I can't seem to get it to work. Do I need to change some bit, since I need it for Service Portal UI?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or has something changed since, it's a 2 yr old post?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I got from this post, please tell me what is wrong here:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading) {
     if (isLoading || newValue == '') {
           return;
     }


     //Type appropriate comment here, and begin script below

var val =g_form.getValue('A');
if(val == 'X'){
 
var elems = document.getElementsByClassName('sc-help-text annotation-wrapper');
   for (var i=0;i&amp;lt;elems.length;i+=1){
 
   if (elems[i].style.display === 'none') {
   elems[i].style.display = 'block';
   }
 
   }
}
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or maybe nothing is wrong with my script, but something else I'm completely missing..&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;Annika&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:27:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518883#M90662</guid>
      <dc:creator>Annika Aaltonen</dc:creator>
      <dc:date>2019-05-20T13:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518884#M90663</link>
      <description>&lt;P&gt;DOM manipulation is not supported in service portal. Please refer below link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/build/service-portal/concept/unsupported_client_scripts.html" rel="nofollow"&gt;https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/build/service-portal/concept/unsupported_client_scripts.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:42:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518884#M90663</guid>
      <dc:creator>VigneshMC</dc:creator>
      <dc:date>2019-05-20T13:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518885#M90664</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/25661i538C3D6F3AD5C177/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:42:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518885#M90664</guid>
      <dc:creator>nayanawadhiya1</dc:creator>
      <dc:date>2019-05-20T13:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518886#M90665</link>
      <description>&lt;P&gt;Thanks! That explains it completely &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Is there any smoother way to do this, than to display some sort of label variable with Cat. UI policy then?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Annika&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:59:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518886#M90665</guid>
      <dc:creator>Annika Aaltonen</dc:creator>
      <dc:date>2019-05-20T13:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518887#M90666</link>
      <description>&lt;P&gt;Try using field message, if that helps your need.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/madrid-application-development/page/script/useful-scripts/reference/r_DisplayFieldMessages.html" rel="nofollow"&gt;https://docs.servicenow.com/bundle/madrid-application-development/page/script/useful-scripts/reference/r_DisplayFieldMessages.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 16:13:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518887#M90666</guid>
      <dc:creator>VigneshMC</dc:creator>
      <dc:date>2019-05-20T16:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518888#M90667</link>
      <description>&lt;P&gt;Hi Vignesh,&lt;/P&gt;
&lt;P&gt;Thanks, this indeed seems very promising!&lt;/P&gt;
&lt;P&gt;However, I tested this field message a bit (with my very limited javascript knowledge), but couldn't get it to work. I'm not 100% convinced this works for SP UI, at least the article doesn't mention SP. Then again alert works, so...&lt;/P&gt;
&lt;P&gt;Can you please show me how to script would look like in onChange Cat. Client Script, when used in the scenario where "Variable A has value X". Appreciate your help, I''m still very new to all of this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Annika&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 07:49:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518888#M90667</guid>
      <dc:creator>Annika Aaltonen</dc:creator>
      <dc:date>2019-05-21T07:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518889#M90668</link>
      <description>&lt;P&gt;I tried below script in my PDI and it works for me.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
if (newValue=='admin'){
	alert('test');
   g_form.showFieldMsg('type_of_request','This is a test','info',true);
}
	 else{
 g_form.hideFieldMsg('type_of_request');
 }
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/25663i26CF2505E97717F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:29:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518889#M90668</guid>
      <dc:creator>VigneshMC</dc:creator>
      <dc:date>2019-05-21T10:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Display help text conditionally in service portal</title>
      <link>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518890#M90669</link>
      <description>&lt;P&gt;Perfect, now it worked, thanks a lot!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Annika&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 07:26:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/display-help-text-conditionally-in-service-portal/m-p/518890#M90669</guid>
      <dc:creator>Annika Aaltonen</dc:creator>
      <dc:date>2019-05-22T07:26:40Z</dc:date>
    </item>
  </channel>
</rss>

