Source: https://nishanth-fern-test.docs-staging.pageloop.ai/web/integrate-whatfix-with-servicenow-using-javascript

# Integrate Whatfix with ServiceNow using JavaScript

Integrating Whatfix with your ServiceNow account enables you to display Whatfix content and widgets on your application.

Use the following steps to integrate Whatfix with your ServiceNow instance;

1. Log in to your ServiceNow instance as an admin and Go to **UI Scripts** under **System UI**.

![ServiceNow\_UIScripts.png](/images/61/ServiceNow_UIScripts-6156d4a8.png)
2\. Click **New** to configure a new script,

![ServiceNow\_UIScripts\_New.png](/images/62/ServiceNow_UIScripts_New-62ad866a.png)
3\. Ensure the **Global** check box is selected. Copy the script below, update your ENTERPRISE ID, paste it in the Script panel, and then click **Submit**.

```plaintext
var head = document.getElementsByTagName('head');
var script = document.createElement("script");
script.setAttribute("src", "//cdn.whatfix.com/prod/<<ent_id>>/embed/embed.nocache.js");
script.setAttribute("type", "text/javascript");
head[0].appendChild(script);

if(window.top != window) {
var head = window.top.document.getElementsByTagName('head');
var script = window.top.document.createElement("script");
script.setAttribute("src", "//cdn.whatfix.com/prod/<<ent_id>>/embed/embed.nocache.js");
script.setAttribute("type", "text/javascript");
head[0].appendChild(script);
}
```

1. Note

Update the correct script src from your Whatfix account in the code block in line 4 and line 13

![ServiceNow\_pasteScript\_check.png](/images/2c/ServiceNow_pasteScript_check-2c1f2815.png)

## Enabling Whatfix Content on Portal pages

If you notice that Whatfix content is still not being displayed on portal pages, continue with the following instructions.

1. In the left panel, click **Portals**. ![serviceNow\_portals.png](/images/97/serviceNow_portals-97b462a2.png)
2. On the **Service Portals** page, under the **Theme** column, click the corresponding link for the portal that you want to enable. ![ServiceNow\_theme\_link.png](/images/da/ServiceNow_theme_link-daf1e768.png)
3. Click the **JS Includes** tab. ![ServiceNow\_JSIncludesTab.png](/images/9c/ServiceNow_JSIncludesTab-9cc12579.png)
4. Click **New**. ![ServiceNow\_JS\_New.png](/images/69/ServiceNow_JS_New-694c808f.png)
5. Enter a display name, in the Source drop-down section, select **UI Script**, and then click the Search icon. ![ServiceNow\_JS\_New\_UI\_search.png](/images/92/ServiceNow_JS_New_UI_search-92793405.png)
6. Select the Whatfix JavaScript that was added in the first section. ![ServiceNow\_JS\_new\_wfxEmbed.png](/images/d8/ServiceNow_JS_new_wfxEmbed-d8a51fee.png)
7. Click **Submit**. ![ServiceNow\_JS\_new\_submit.png](/images/c9/ServiceNow_JS_new_submit-c954c7e9.png)
8. Click **Update**. ![ServiceNow\_JS\_New\_Update.png](/images/23/ServiceNow_JS_New_Update-23238010.png)

## Related

- [ServiceNow Integration](/web/servicenow-integration-1)
