Show/hide widget based on incident state

Ashwin Perumal1
Tera Contributor

Hello All,

I have created a simple widget that displays a text when user open an incident from portal in my requests page. The below is the HTML code done for displaying text in portal

HTML:

<div class="displaytext">
<h2>{{::options.title}}</h2>
</div>

 I added the widget in required page and in instance option we have title filed where i have entered the required text to display in portal. Attached screenshot below

AshwinPerumal1_1-1717048900936.png


My requirement is to display the text "Display text" only when the Incident state is New. My custom text widget should be hidden when incident state is not new. I tried using Glide Record of incident table in server script and used ng-if directive in html but still I am not able to achieve the required. Can anyone help to achieve this by showing the custom widget based on incident state.

 

Thanks in advance




1 REPLY 1

Community Alums
Not applicable

Hi @Ashwin Perumal1 ,

Please see below community post and Youtube video which go through how a customer can achieve the behavior in their Service Portal.

https://community.servicenow.com/community?id=community_question&sys_id=e36576ebdb261b40fece0b55ca96...

https://www.youtube.com/watch?time_continue=6&v=-eJMULIa43A