Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Embedding widget in Service Catalog form

TouriaL
Tera Contributor

In Service Catalog you have the ability to embed a widget as a variable in your catalog items or record producers.

"In this example, we will create a loader widget that will only be displayed if the variable choices are empty if the server's response is slow."

  • Create a catalog item with variables
  • Create widget called add-panel-loader
  • In the html template add the following code

             <div class="panel-loader" style="text-align: center">
                            <fa name="spinner" spin="true"></fa>
                            <p>${Loading data}...</p>
              </div>​

 

 

  • In related lists, add a new variable to the catalog item.
  • In the Type field, select Custom.
  • In the type specifications, select a widget that performs the desired action (see screenshot)TouriaL_0-1683644837566.png

     

  • You can hide/show the widget loader if you want to check the variable choices (or server response) .

Using this method, you can easily display the widget in your catalog items and improve the user experience for your employees.

TouriaL_2-1683645032120.png

 

 

1 REPLY 1

Cire
Tera Contributor

Hi Touria, 

Thank you for this useful Tip. 

Regards,