how can we populate Third Party data in Service Portal

Manikanta Kota
Mega Guru

Hi everyone,

 

if got Data from any third party through integration with Service Now, how can we populate that data in Service Portal, Any Idea on this.

 

Regards, 

Manikanta. Kota

5 REPLIES 5

Sai Krishna6147
Mega Guru

Hi @Manikanta Kota 

To display data from a third-party integration in the ServiceNow Service Portal, follow these steps:

1. Ensure Data Retrieval Through Integration:

  • First, confirm that the data is being successfully retrieved and stored in ServiceNow tables via the integration.
  • You can use integration mechanisms like REST API, SOAP, or MID Server to pull data from third-party sources.

2. Create a Custom Widget:

  • In Service Portal, data is typically displayed using widgets. You'll need to create or modify a widget to show the data from the third party.

Steps to Create a Custom Widget:

  • Navigate to Service Portal > Service Portal Configuration > Widget Editor.
  • Create a new widget or modify an existing one.
  • Use the server script to retrieve data from the ServiceNow table where the third-party data is stored.
  • Use the client controller and HTML to render the data in the Service Portal.

Example: Fetching Data in the Server Script

 

 

(function() {
   var thirdPartyData = [];
   // Replace 'your_table' with the actual table name
   var gr = new GlideRecord('your_table');
   gr.query();
   while (gr.next()) {
      thirdPartyData.push({
         field1: gr.getValue('field1'),
         field2: gr.getValue('field2'),
         // Add other fields as necessary
      });
   }
   return {
      data: thirdPartyData
   };
})();

 

Example: Displaying Data in the Client Script

 

function($scope) {
   $scope.thirdPartyData = $scope.data.thirdPartyData;
}

 

Example: Rendering Data in HTML Template

 

<div ng-repeat="item in thirdPartyData">
   <p>Field 1: {{item.field1}}</p>
   <p>Field 2: {{item.field2}}</p>
</div>

 

3. Create a Portal Page or Add the Widget to an Existing Page:

  • After creating the widget, add it to a Service Portal page.
  • You can create a new portal page or modify an existing one:
    • Navigate to Service Portal > Pages.
    • Add the newly created widget to the desired location on the page.

4. Use GlideRecord (Server-Side) or REST API (Client-Side):

  • You can fetch data using GlideRecord for server-side data manipulation.
  • Alternatively, if you prefer client-side data fetching, you can use ServiceNow’s REST API within a widget.

5. Security and Permissions:

  • Make sure that the appropriate users have the required permissions to view the data.
  • You may need to define access controls (ACLs) or adjust permissions to ensure data is displayed only to authorized users.

This is a general approach to display third-party data in ServiceNow’s Service Portal.

 

If my response proves useful, please indicate its helpfulness by selecting " Helpful." This action benefits both the community and me.

Thanks & Regards
Venkata Sai Krishna Bandela