# ServiceNow : Custom App

### Objective <a href="#toc91093885" id="toc91093885"></a>

This guide will help you to quickly connect to ServiceNow and create various methods to pull the data. The purpose is to demonstrate how easy it is to integrate an external database to the iX Hello platform.

### Pre-requisites <a href="#toc91093886" id="toc91093886"></a>

1. **Create ServiceNow account**

You should have an ServiceNow account, at least one instance and application registered in the ServiceNow. You can follow this document for complete guidance.

1. **Configure Integration with iX Hello**

Once the ServiceNow account is ready, the next step is to configure integration with the iX Hello portal. Follow this guide to complete the configurations.

### Steps <a href="#toc91093887" id="toc91093887"></a>

To proceed with these steps, you should have all the pre-requisites satisfied. If you are missing something, please go back and make sure you satisfy all of them.

Once done, you are ready to get started using iX Hello platform with ServiceNow.

### Step 1 Connect to ServiceNow <a href="#toc91093888" id="toc91093888"></a>

Login to the iX Hello portal at [https://portal.voiceworx.ai](https://portal.voiceworx.ai/)

To Configure SeviceNow, browse to: Integration > Connect System > Connect External System in the iX Hello platform and select options as shown below. Make sure that Prerequisite#2 has been fulfilled by your organization administrator before proceeding with this.

<figure><img src="/files/LPdtBUKCS1fQCx4xgdYs" alt=""><figcaption></figcaption></figure>

On Clicking connect system, the user will be prompted to allow access to the developer instance in SeviceNow.

Enter the login credentials and click “Login”.

<figure><img src="/files/oa1qNIeqOa6POVFXOM0W" alt="" width="375"><figcaption></figcaption></figure>

1. After a successful login to ServiceNow, SmartOffice would request to connect with your ServiceNow instance. Click the “**Allow**” button. Connection of iX Hello portal with ServiceNow will be successful after the access has been allowed as shown below:

<figure><img src="/files/Vhq8JQ77F1QLDwraW7Cj" alt=""><figcaption></figcaption></figure>

If you face issues in this connection, you might want to go and visit ServiceNow: Connect to iX Hello document guide.

1. Your ServiceNow integration is now available for use in iX Hello portal.

<figure><img src="/files/1EOLrzcNS1r1ik61mdJb" alt=""><figcaption></figcaption></figure>

### Step 2 Create an App for ServiceNow <a href="#toc91093889" id="toc91093889"></a>

To create an app, browse to Custom Apps and click on New Custom App button as shown below.

<figure><img src="/files/ZkbTcY85k5lA564LNEpL" alt=""><figcaption></figcaption></figure>

You should see a small popup as shown below.

<figure><img src="/files/lvwyKsrxCK1x0aSCGjVE" alt="" width="375"><figcaption></figcaption></figure>

| Input             | Information                            |
| ----------------- | -------------------------------------- |
|                   |                                        |
| Name              | You can give any value of your choice. |
| Custom Skill Type | Select Search                          |
| Category          | Default.                               |

Click on save, this will create an app and you should see a screen as shown below,

<figure><img src="/files/vzoCTvinp3AR1eIqnhHR" alt=""><figcaption></figcaption></figure>

This shows that an app is successfully created, and you have various options like setup data sources. This is explained in next step.

### Step 3 Create a Data Source <a href="#toc91093890" id="toc91093890"></a>

To follow this step, make sure you have completed above Step 2. If not please go back and do it.

A Data Source connects the app with the ServiceNow integration we did in Step #1. Once you have an app created, you can go o Data Sources by either clicking on “Data Source” button or by clicking on “Data Sources” tab.

Now you should see screen as shown below.

<figure><img src="/files/Rc2cZtPba23pJGgsuJgf" alt=""><figcaption></figcaption></figure>

To create a data source, click on ‘Create New Data Source’ button and you should see a popup screen as shown below

<figure><img src="/files/YvDIqsJiU7Zt7qgGxsNO" alt="" width="375"><figcaption></figcaption></figure>

Give a name of your choice and make sure you select the ServiceNow integration that you have created in Step 1 and click on Save. Now you should see a Data Source created as shown in below screenshot.

<figure><img src="/files/0JkGnqWkqiEKYZ4sZTdz" alt=""><figcaption></figcaption></figure>

once a data source is created, you are ready to start creating various methods.

### Step 4 Create Methods to fetch the data from ServiceNow <a href="#toc91093891" id="toc91093891"></a>

To use this step, make sure you have completed previous step. If not go back and complete it.

Methods allows you to fetch data from the ServiceNow table. To access the methods, click on the “Methods” tab which is next to the “Data Sources” tab.

<figure><img src="/files/9EajCUJZs8wEyLDjCYHx" alt=""><figcaption></figcaption></figure>

As of the publication date of this document, the iX Hello platform supports following DynamoDB methods,

1. Create Ticket
2. Create Ticket by Priority
3. Execute Query
4. Get All Tickets
5. Get Open Tickets
6. Get Tickets by Assignee
7. Get Tickets by Priority
8. Get Tickets by Requester
9. Get Tickets by Status
10. Get Tickets by Subject
11. Get Tickets Count by Assignee
12. Get Tickets Count by Priority
13. Get Tickets Count by Requester
14. Get Tickets Count by Status

Depending on requirement, you will have to use an appropriate method, this document will explain each of these methods with an example.

Let’s start with a use case.

### **Scenario/ Use Case (ServiceNow Assistant):** <a href="#toc91093892" id="toc91093892"></a>

You have a ServiceNow to organize ticketing in your organization.

You want to create a ticket for an issue you are facing. For this, you can use CreateTicket method as explained below.

### Method: CreateTicket <a href="#toc91093893" id="toc91093893"></a>

This method requires three parameters as explained below.

#### Parameters: <a href="#toc91093894" id="toc91093894"></a>

| Parameter        | Sample Value                                                                                   | Info                                                   |
| ---------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|                  |                                                                                                |                                                        |
| ShortDescription | <p>{{ShortDescription}}</p><p>To be entered by the user.</p>                                   | A short description on what the ticket is for.         |
| Priority         | <p>Moderate</p><p>(To be selected from dropdown depending upon the urgency of the ticket.)</p> | Key Value pair in a *valid json* format.               |
| RequesterEmail   | <p>{{Context.Email}}</p><p>This shall draw the email you are logged in with in iX Hello.</p>   | Email from which the ticket create request originated. |

Other than these two parameters, you need to provide the following standard inputs

| Parameter       | Info                                                                                                                                                                                                                                                                                                                 |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                 |                                                                                                                                                                                                                                                                                                                      |
| Method Name     | You can give any name. This name will be displayed in the methods list.                                                                                                                                                                                                                                              |
| Request Type    | <p><strong>CreateTicket</strong></p><p>This is the method that you are using</p>                                                                                                                                                                                                                                     |
| Parameters      | As explained in the previous table                                                                                                                                                                                                                                                                                   |
| Result Type     | <p>Record (Auto Selected)</p><p>It indicates that the method can return one or more records</p>                                                                                                                                                                                                                      |
| Record JsonPath | <p>Each method returns data in json format and to pick any specific information from the json, we need to specify the <em>Record JsonPath</em> so Voice Worx platform will pick that data in consideration while displaying results.</p><p>Example: $.\[\*]</p><p>This selects all the records that is returned.</p> |
| Result Template | <p>This indicates how method results should be represented.</p><p>Here its providing confirmation that the ticket has been created.</p><p>Great I was able to create the ticket for you. How else can I help you?</p>                                                                                                |
|                 |                                                                                                                                                                                                                                                                                                                      |

<figure><img src="/files/4swHPVXeuOpfmIiL94qT" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/a9n9LHBgRWKMt33Lgkh1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/vzndkQRVIrTjRen0IKx3" alt=""><figcaption></figcaption></figure>

### Result : <a href="#toc91093895" id="toc91093895"></a>

<figure><img src="/files/i6Au4y9MaiPCbIuyBJr2" alt=""><figcaption></figcaption></figure>

### Method: GetOpenTickets <a href="#toc91093895" id="toc91093895"></a>

Create new method

| Parameter             | Info                                                                                                                                                                                                                                                                                                                 |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       |                                                                                                                                                                                                                                                                                                                      |
| Method Name           | GetOpenTickets                                                                                                                                                                                                                                                                                                       |
| Request Type          | <p><strong>GetOpenTickets</strong></p><p>This is the method that you are using</p>                                                                                                                                                                                                                                   |
| Parameters            | As explained in the previous table. No parameters for this method                                                                                                                                                                                                                                                    |
| Result Type           | <p>ListOfRecords (Auto Selected)</p><p>It indicates that the method can return one or more records</p>                                                                                                                                                                                                               |
| Record Limit          | <p>Numeric value (e.g. 10)</p><p>If Method is returning larger number of records, then you can limit this result by providing this value.</p>                                                                                                                                                                        |
| Record JsonPath       | <p>Each method returns data in json format and to pick any specific information from the json, we need to specify the <em>Record JsonPath</em> so Voice Worx platform will pick that data in consideration while displaying results.</p><p>Example: $.\[\*]</p><p>This selects all the records that is returned.</p> |
| Record Template       | <p>Ticket Number: {{number}} - {{short\_description}}</p><p>Note:</p><p>Anything written in between {{ }} is represented as a json field and it’s case-sensitive.</p>                                                                                                                                                |
| Result Template       | Here are the open tickets I've found{{Records}.How else can I help you?                                                                                                                                                                                                                                              |
| Empty Result Template | <p>Sorry, no open tickets found. How else can I help you?</p><p>This message is returned if data that matches the method condition is not found.</p>                                                                                                                                                                 |

#### Parameters: Not required <a href="#toc91093896" id="toc91093896"></a>

<figure><img src="/files/3hGlJyPWz0unZwFmT2XL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ffZKikDcz6SRTF7fyfTs" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MneFayHwjJ5mgz2jQLJq" alt=""><figcaption></figcaption></figure>

#### Sample Response: <a href="#toc91093897" id="toc91093897"></a>

<figure><img src="/files/RkjqeRI9HOif2HHPyZFP" alt=""><figcaption></figcaption></figure>

### Method: GetTicketsByStatus <a href="#toc91093898" id="toc91093898"></a>

#### Parameters: <a href="#toc91093899" id="toc91093899"></a>

| Parameter | Sample Value | Info                                                                                                                                         |
| --------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|           |              |                                                                                                                                              |
| Status    | New          | <p>Available status values are:</p><ol><li>New</li><li>InProgress</li><li>OnHold</li><li>Resolved</li><li>Closed</li><li>Cancelled</li></ol> |

| Parameter             | Info                                                                                                                                                                                                                                                                                                                 |   |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
|                       |                                                                                                                                                                                                                                                                                                                      |   |
| Method Name           | GetTicketsByNewStatus                                                                                                                                                                                                                                                                                                |   |
| Request Type          | <p><strong>GetTicketsByStatus</strong></p><p>This is the method that you are using</p>                                                                                                                                                                                                                               |   |
| Parameters            | Status: New                                                                                                                                                                                                                                                                                                          |   |
| Result Type           | <p>ListOfRecords (Auto Selected)</p><p>It indicates that the method can return one or more records</p>                                                                                                                                                                                                               |   |
| Record Limit          | <p>Numeric value (e.g. 10)</p><p>If Method is returning larger number of records, then you can limit this result by providing this value.</p>                                                                                                                                                                        |   |
| Record JsonPath       | <p>Each method returns data in json format and to pick any specific information from the json, we need to specify the <em>Record JsonPath</em> so Voice Worx platform will pick that data in consideration while displaying results.</p><p>Example: $.\[\*]</p><p>This selects all the records that is returned.</p> |   |
| Record Template       | <p>Ticket Number {{number}} - {{short\_description}}</p><p>Note:</p><p>Anything written in between {{ }} is represented as a json field and it’s case-sensitive.</p>                                                                                                                                                 |   |
| Result Template       | Here are the new tickets I've found {{Records}}. How else can I help you?                                                                                                                                                                                                                                            |   |
| Empty Result Template | Sorry, no new tickets found. How else can I help you?                                                                                                                                                                                                                                                                |   |

<figure><img src="/files/Kff5fcBabMzD0gpO3LhN" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/EpU6K895OsYUzen3ovVq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/YzdkSf83fpNQjrleJc9c" alt=""><figcaption></figcaption></figure>

Sample Response:

<figure><img src="/files/90LiE9RGcoaa5Vdbse5i" alt=""><figcaption></figcaption></figure>

### Method: GetTicketsByRequester <a href="#toc91093900" id="toc91093900"></a>

#### Parameters: <a href="#toc91093901" id="toc91093901"></a>

| Parameter | Sample Value  | Info                    |
| --------- | ------------- | ----------------------- |
|           |               |                         |
| Requester | {{Requester}} | Requester of the ticket |

| Parameter             | Info                                                                                                                                                                                                                                                                                                                 |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       |                                                                                                                                                                                                                                                                                                                      |
| Method Name           | GetTicketsByRequester                                                                                                                                                                                                                                                                                                |
| Request Type          | <p><strong>GetTicketsByRequester</strong></p><p>This is the method that you are using</p>                                                                                                                                                                                                                            |
| Parameters            | Status: New                                                                                                                                                                                                                                                                                                          |
| Result Type           | <p>ListOfRecords (Auto Selected)</p><p>It indicates that the method can return one or more records</p>                                                                                                                                                                                                               |
| Record Limit          | <p>Numeric value (e.g. 10)</p><p>If Method is returning larger number of records, then you can limit this result by providing this value.</p>                                                                                                                                                                        |
| Record JsonPath       | <p>Each method returns data in json format and to pick any specific information from the json, we need to specify the <em>Record JsonPath</em> so Voice Worx platform will pick that data in consideration while displaying results.</p><p>Example: $.\[\*]</p><p>This selects all the records that is returned.</p> |
| Record Template       | <p>Ticket Number {{number}} - {{short\_description}}</p><p>Note:</p><p>Anything written in between {{ }} is represented as a json field and it’s case-sensitive.</p>                                                                                                                                                 |
| Result Template       | Here are the tickets requested by {{Input.Requester}}. How else can I help you?                                                                                                                                                                                                                                      |
| Empty Result Template | Sorry, no new tickets found for {{Requester}}. How else can I help you?                                                                                                                                                                                                                                              |

<figure><img src="/files/BMJhisall8IaWSCdHL9N" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/98xbv1rCT4RXAHzaPd2r" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/OuOgVjKnEv67tYvmrKVS" alt=""><figcaption></figcaption></figure>

#### Sample Response: <a href="#toc91093902" id="toc91093902"></a>

![](/files/UB0t2ozmK0gfCAdrwdvY)

Similarly, all methods available for ServiceNow can be customized.

### **Method : GetTicketbyAssignee**

<figure><img src="/files/HVRgnsTZHx5e7EKvHkXM" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/SgFvNKBJNa2VNJgBkgOl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CGNG8C9bteNPLYOpJ3R7" alt=""><figcaption></figcaption></figure>

### Sample Response: <a href="#toc91093903" id="toc91093903"></a>

<figure><img src="/files/Zbc9xn2I9TYjH8ZJxZQI" alt=""><figcaption></figcaption></figure>

### Create Intents: <a href="#toc91093903" id="toc91093903"></a>

The next step of app building is creating corresponding Intents for the above methods.

#### CreateTicketIntent <a href="#toc91093904" id="toc91093904"></a>

**Name:** CreateTicketIntent

**Intent Type:** Search

**Intent Action:** Execute Method

**Data Source:** ServiceNowDS

**Data Source Method:** CreateTicket

<figure><img src="/files/3s4AaUtgb9fRYPrEd6qn" alt="" width="375"><figcaption></figcaption></figure>

GetTicketsByAssignee

**Name:** GetTicketsByAssigneeIntent

**Intent Type:** Search

**Intent Action:** Execute Method

**Data Source:** ServiceNowDS

**Data Source Method:** GetTicketsByAssignee

<figure><img src="/files/x74OrpnmJ9Nc30Nhr0hL" alt="" width="375"><figcaption></figcaption></figure>

Now, repeat the same process for other remaining methods.

GetOpenTicketIntent

**Name:** GetOpenTicketIntent

**Intent Type:** Search

**Intent Action:** Execute Method

**Data Source:** ServiceNowDS

**Data Source Method:** GetOpenTicketMethod

<figure><img src="/files/VigFjuAMTwymhNoM8njk" alt="" width="375"><figcaption></figcaption></figure>

GetTicketByNewStatusIntent

**Name:** GetTicketByNewStatusIntent

**Intent Type:** Search

**Intent Action:** Execute Method

**Data Source:** ServiceNowDS

**Data Source Method:** GetTicketByNewStatusMethod

<figure><img src="/files/knqw7PGrUxBpT5kvt5NG" alt="" width="375"><figcaption></figcaption></figure>

GetTicketByRequesterIntent

**Name:** GetTicketByRequesterIntent

**Intent Type:** Search

**Intent Action:** Execute Method

**Data Source:** ServiceNowDS

**Data Source Method:** GetTicketByRequesterMethod

<figure><img src="/files/kXjiccjLbN0SLcxT88Vz" alt="" width="375"><figcaption></figcaption></figure>

### Create Slots <a href="#toc91093905" id="toc91093905"></a>

You have to create slots corresponding to the parameters in the above created method. For example, for method GetTicketsByAssignee, Assignee was the parameter used. Now, create Assignee as the Slot for GetTicketsByAssignee.

**Details: Get Tickets By Assignee**

**Name:** Assignee

**Slot Order: 0**

**Reprompt Message:** Whose tickets shall I search?

**Type**: Full Name

**Custom App:** ServiceNow Demo

**Intent:** GetTicketsByAssignee

<figure><img src="/files/4RvDRV9JpazmfVtGcUzM" alt="" width="375"><figcaption></figcaption></figure>

**Details: Create Ticket Intent**

**Name:** ShortDescription

**Slot Order: 0**

**Reprompt Message:** ShortDescription

**Type**: Text

**Custom App:** ServiceNow Demo

**Intent:** CreateTicketIntent

<figure><img src="/files/UT5iIuj64LqogZmimKcS" alt="" width="375"><figcaption></figcaption></figure>

**Details: Create Ticket Intent**

**Name:** Context.Email

**Slot Order: 0**

**Reprompt Message:** Context.Email

**Type**: Emailaddress

**Custom App:** ServiceNow Demo

**Intent:** CreateTicketIntent

<figure><img src="/files/UbqYwnBTaibfsSdSpE6P" alt="" width="375"><figcaption></figcaption></figure>

**Details:** GetTicketByRequesterIntent

**Name:** Requester

**Slot Order: 0**

**Reprompt Message:**&#x20;

**Type**: Full name

**Custom App:** ServiceNow Demo

**Intent:** GetTicketByRequesterIntent

<figure><img src="/files/emjbtZCqF96BtmOvFOog" alt="" width="375"><figcaption></figcaption></figure>

### Create Utterances: <a href="#toc91093906" id="toc91093906"></a>

Utterances are used for invocating the intent. You have to create utterances corresponding to each intent. For example, let’s create utterance for CreateTicketIntent.

Go to Utterances tab, select CreateTicketIntent in the dropdown and click on ‘Create New Utterance’.

You can also create multiple utterance for an intent. You can also opt for the Bulk Edit feature to create multiple utterances at one go.

Again, you have to create utterances for every intent.

**Utterance for: CreateTicketIntent**

<figure><img src="/files/yqCrRD9sA6GJ8y3uZaRY" alt="" width="563"><figcaption></figcaption></figure>

**Utterance for: GetOpenTicketIntent**

<figure><img src="/files/k0FPw8ra3200AxT1rlcT" alt="" width="563"><figcaption></figcaption></figure>

**Utterance for: GetTicketByNewStatusIntent**

<figure><img src="/files/ptBQj8olrfCsObGwPU6V" alt="" width="563"><figcaption></figcaption></figure>

**Utterance for: GetTicketByRequesterIntent**

<figure><img src="/files/tktXLhHg3hl8JdCGibUr" alt="" width="563"><figcaption></figcaption></figure>

**Utterance for: GetTicketsByAssigneeIntent**

<figure><img src="/files/1AakTBgf6LKwkYKWgEkg" alt="" width="563"><figcaption></figcaption></figure>

### Create Inputs <a href="#toc91093907" id="toc91093907"></a>

Now, create inputs corresponding to the intents created in above steps. One input corresponding to one intent has to be created.

**Details:**

**Name:** GetTicketsByRequester

Custom Skill: ServiceNow Demo

Custom Intent: GetTicketsByRequesterIntent (any intent you’ve created)

Data Source: ServiceNowDS

Data Source Method: GetTicketsByRequester

<figure><img src="/files/2MgbLbS37mx8Q2I5Pqw2" alt="" width="563"><figcaption></figcaption></figure>

**Details : GetTicketbyAssigneeInput**

<figure><img src="/files/kYys3IO1Y4AJ79kGnKZ2" alt="" width="563"><figcaption></figcaption></figure>

### Details: CreateTicketInput <a href="#toc91093908" id="toc91093908"></a>

<figure><img src="/files/G06KIB9kBmk3NlmMrS1b" alt="" width="563"><figcaption></figcaption></figure>

### Details:  GetOpenTicketInput <a href="#toc91093908" id="toc91093908"></a>

<figure><img src="/files/jbil7WiTLsprPMrq4xjB" alt="" width="563"><figcaption></figcaption></figure>

### Details : GetTicketByNewStatusInput <a href="#toc91093908" id="toc91093908"></a>

<figure><img src="/files/FHwBB8Sx53urXEjkweuq" alt="" width="563"><figcaption></figcaption></figure>

#### Manage Input Parameters

GetTicketsByRequester :&#x20;

<figure><img src="/files/brveiHFXYTaU4A2jRvF5" alt="" width="563"><figcaption></figcaption></figure>

### &#x20;CreateTicketInput <a href="#toc91093908" id="toc91093908"></a>

<figure><img src="/files/Y3FERRXTs8nKPN3Z8jUh" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/1SGd5XgglcsBdVDTRAvL" alt="" width="563"><figcaption></figcaption></figure>

GetTicketbyAssigneeInput

<figure><img src="/files/IQ2hxOotwP9C28UtqsHQ" alt="" width="563"><figcaption></figcaption></figure>

### Publish App <a href="#toc91093908" id="toc91093908"></a>

The final step is to publish app to your desired channel. Let’s publish the app to Alexa for this demo.

Select Publish tab and click on Add App Publishing.

After the setup is done, Publish the App to Alexa.

Select the LWA account and click on publish.

You shall get the success message and you can go to your Alexa developer account and test the app by clicking on Go to Alexa Skill. Make sure to log in with the same LWA credential to which the app has been published.

### Few Snaps of ServiceNow Assistant Test on Alexa Developer Console. <a href="#toc91093909" id="toc91093909"></a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ixhello.com/ixhc/connections/servicenow/servicenow-custom-app.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
