# ServiceNow integration with FileWave

ServiceNow can be provided with device inventory information from FileWave to make the ServiceNow experience much more accurate and rewarding. Previously, a ServiceNow portal app was required to supply this FileWave data, but as of version Orlando of ServiceNow that is no longer required, and the FileWave API can be used directly. This guide, provided as a courtesy for a non-FileWave related system, will show you how to bring the information gathered by FileWave inventory into ServiceNow using the API.

<p class="callout danger">**Third Party Software** ServiceNow is a third party application. The details provided are for example only and are unsupported by FileWave.</p>

## Step-by-Step Guide

### Step 1: Create Data Source

<table id="bkmrk-system-import-sets-%3E" style="width: 100%;"><tbody><tr><td style="width: 28.0509%;"><a id="bkmrk-"></a>**System Import Sets &gt; Administration &gt; Data Sources &gt; New**

1. NAME: FileWave REST API
2. IMPORT SET LABEL: (empty)
3. IMPORT SET TABLE NAME: u\_fw\_api
4. TYPE: REST
5. FORMAT: JSON
6. PATH FOR EACH ROW: /values/values
7. DISCARD ARRAYS: √
8. EXPAND: √
9. DATA IN SINGLE COLUMN: (unchecked)
10. APP: Global
11. REQUEST ACTION: Hit the “click here” and create one (see Step 2)

</td><td style="width: 71.9491%;">![](https://kb.filewave.com/uploads/images/gallery/2023-07/eyf9O555DfXB4Qzk-embedded-image-xuthosas.png)

</td></tr></tbody></table>

### Step 2: Create Request Action

<table id="bkmrk-name%3A-get-fw-rest-ac"><tbody><tr><td>1. NAME: GET FW REST
2. ACCESSIBLE FROM: All application scopes
3. CATEGORY: (empty)
4. PROTECTION: —None—
5. DESCRIPTION: (empty)
6. APPLICATION: Global
7. IN-FLOW ANNOTATION: (empty)
8. Then hit "Submit"

(You should be redirected to the Flow Designer for GET FW REST...see Step 3)

</td><td>![Request Action](https://kb.filewave.com/uploads/images/gallery/2023-07/w2gjuTJbcu0yhg65-embedded-image-pue4n47v.png)

</td></tr></tbody></table>

### Step 3, Part 1: Create in Flow Designer

<table id="bkmrk-create-in-flow-desig"><tbody><tr><td>***Create in FLOW DESIGNER, Select #1 “REST step”***

<a id="bkmrk--1"></a>**- Connection Details -**

- CONNECTION: Define connection inline
- CREDENTIAL ALIAS: (empty)
- USE MID: (unchecked)
- BASE URL: [https://YOUR.FILEWAVE.FQDN:20445/inv/api/v1/query\_result\_extended/](https://YOUR.FILEWAVE.FQDN:20445/inv/api/v1/query_result_extended/)

<a id="bkmrk--2"></a>**-Request Details-**

- BUILD REQUEST: Manually
- RESOURCES PATH: (empty)
- HTTP METHOD: POST

<table><tbody><tr><td><p class="callout success">The reason this is a POST is so we don't rely on an inventory query that might be changed.  
  
Customize the fields portion as needed.  
  
This is an example of custom fields. If the field named "asset\_tag" does not exist in your system, this will cause an error.  
  
</p>

```json
        {
            "column": "asset_tag",
            "component": "CustomFields"
        }
```

  
</td></tr></tbody></table>

- QUERY PARAMETERS: (empty)
- HEADERS: 
    1. Name: Authorization  
        Value: Your Users Application Token (FW Admin &gt; Assistants &gt; Manage Administrators &gt; (select admin) &gt; Application Tokens &gt; (Copy the base64: e.g. aalkjdlAKJDlakjdALkdsjaldksja= )
    2. Name: Content-Type  
        Value: application/json

**-Request Content-**

- REQUEST TYPE: Text
- REQUEST BODY: - See "Request JSON" example below:

**Request JSON**

```json
{
    "criteria": {
        "expressions": [
            {
                "column": "filewave_client_name",
                "component": "Client",
                "operator": "is_not",
                "qualifier": null
            },
            {
                "column": "last_check_in",
                "component": "Client",
                "operator": "!=",
                "qualifier": null
            }
        ],
        "logic": "all"
    },
    "fields": [
        {
            "column": "filewave_id",
            "component": "Client"
        },
        {
            "column": "filewave_client_name",
            "component": "Client"
        },
        {
            "column": "current_ip_address",
            "component": "Client"
        },
        {
            "column": "last_check_in",
            "component": "Client"
        },
        {
            "column": "latitude",
            "component": "GeoLocation"
        },
        {
            "column": "longitude",
            "component": "GeoLocation"
        },
        {
            "column": "type",
            "component": "OperatingSystem"
        },
        {
            "column": "version",
            "component": "OperatingSystem"
        },
        {
            "column": "filewave_client_version",
            "component": "AndroidClient"
        },
        {
            "column": "filewave_client_version",
            "component": "DesktopClient"
        },
        {
            "column": "cpu_count",
            "component": "Client"
        },
        {
            "column": "cpu_speed",
            "component": "Client"
        },
        {
            "column": "ram_size",
            "component": "Client"
        },
        {
            "column": "total_disk_space",
            "component": "Client"
        },
        {
            "column": "free_disk_space",
            "component": "Client"
        },
        {
            "column": "serial_number",
            "component": "Client"
        },
        {
            "column": "asset_tag",
            "component": "CustomFields"
        }
    ],
    "main_component": "Client"
}
```

-Retry Policy-

- ENABLE RETRY POLICY: (unchecked)
- Save
- Test Connection 
    - Test &gt; Use “test” for “Attachment Name” &gt; Run Test
    - Select the “Action has been executed. To view action, click here.”
    - Verify: status code of 200 (means success)
    - Select the “(gear) GET FW REST” flow designer tab
    - Close the “Test Action” window with the X
- Select Publish

Close this browser window/tab to return to the “New Record | Data Source | ServiceNow” window/tab

</td><td>![](https://kb.filewave.com/uploads/images/gallery/2023-07/lSij7W8EB7aWx5r4-embedded-image-ihvhkquf.png)![](https://kb.filewave.com/uploads/images/gallery/2023-07/HbhzVJPvP3a5jSQw-embedded-image-dqov9w8z.png)

</td></tr></tbody></table>

### Step3, Part 2: Set Request Action

<table id="bkmrk-under-request-action"><tbody><tr><td>Under REQUEST ACTION, start typing the name of the Action we just created "GET FW REST" and select it from the drop-down.

Submit

Hitting 'Submit' will redirect you back to the Data Source list. Select the one we just made, FileWave REST API and select "Load All Records" under Related Links

Once the test has completed, go back to FileWave REST API's Data Source page and continue to next step.

</td><td>![](https://kb.filewave.com/uploads/images/gallery/2023-07/WMmYZRRL84D1ntyT-embedded-image-zmqfmkoj.png)

</td></tr></tbody></table>

### Step 3, Part 3: Generate Data Transform

<table id="bkmrk-generate-transform%28s"><tbody><tr><td>**Generate Transform(s)**

— MAKING TRANSFORMS ––

On the FileWave REST API page, scroll down to the “Transforms” tab and select “New”

- NAME: FW API Map
- SOURCE TABLE: (should auto fill the u\_fw\_api table)
- ACTIVE: √
- RUN BUSINESS RULES: √
- ENFORCE MANDATORY FIELDS: No
- COPY EMPTY FIELDS: (unchecked)
- CREATE NEW RECORD ON EMPTY COALESCE FIELDS: √
- APPLICATION: Global (input disabled)
- CREATED: Will auto-generate with Date/Time stamp when saved (input disabled)
- TARGET TABLE: Computer \[cmdb\_ci\_computer\]
- ORDER: 100
- RUN SCRIPT: (unchecked)

</td><td>![Table Transform Map](https://kb.filewave.com/uploads/images/gallery/2023-07/r0AxotNIawj1sEqR-embedded-image-bbpuvdn9.png)

</td></tr><tr><td>Select “Mapping Assist” under Related Links

You should be able to map a lot of the client's information, for example...

<table><tbody><tr style="background-color: rgb(251, 238, 184);"><td>FileWave

</td><td>ServiceNow

</td></tr><tr><td>operatingsystem\_type

</td><td>Operating System

</td></tr><tr><td>client\_cpu\_count

</td><td>cpu\_count

</td></tr><tr><td>client\_current\_ip\_address

</td><td>ip\_address

</td></tr><tr><td>client\_ram\_size

</td><td>ram

</td></tr><tr><td>customfields\_asset\_tag

</td><td>asset\_tag

</td></tr><tr><td>client\_total\_disk\_space

</td><td>disk\_space

</td></tr><tr><td>operatingsystem\_version

</td><td>os\_version

</td></tr><tr><td>client\_cpu\_speed

</td><td>cpu\_speed

</td></tr><tr><td>client\_filewave\_client\_name

</td><td>name

</td></tr><tr><td>client\_serial\_number

</td><td>serial\_number

</td></tr><tr><td>...

</td><td> </td></tr></tbody></table>

</td><td>![Mapping Assist](https://kb.filewave.com/uploads/images/gallery/2023-07/YqOYjvh2xGqFIbiE-embedded-image-caarjom2.png)

</td></tr></tbody></table>

  
You can make more maps, like this example for location data:

Scroll down to the “Transforms” tab and select “New”

- NAME: FW Location Map
- SOURCE TABLE: (should auto fill the u\_fw\_api table)
- ACTIVE: √
- RUN BUSINESS RULES: √
- ENFORCE MANDATORY FIELDS: No
- COPY EMPTY FIELDS: (unchecked)
- CREATE NEW RECORD ON EMPTY COALESCE FIELDS: √
- APPLICATION: Global (disabled)
- CREATED: (disabled)
- TARGET TABLE: Location \[cmn\_location\]
- ORDER: 100
- RUN SCRIPT: (unchecked)

Select “Mapping Assist”

<table id="bkmrk-filewave-servicenow-" style="width: 58.3951%;"><tbody><tr style="background-color: rgb(251, 238, 184);"><td style="width: 68.0556%;">FileWave

</td><td style="width: 31.9444%;">ServiceNow

</td></tr><tr><td style="width: 68.0556%;">geolocation\_latitude

</td><td style="width: 31.9444%;">latitude

</td></tr><tr><td style="width: 68.0556%;">geolocation\_longitude

</td><td style="width: 31.9444%;">longitude

</td></tr><tr><td style="width: 68.0556%;">client\_filewave\_client\_name

</td><td style="width: 31.9444%;">Name

</td></tr></tbody></table>

Once you're finished, save your data, update the Table Transform Map form and continue to next steps.

### Part 4: Schedule the Job

  
Schedule the job

Schedule the import task you just created...recommend at least daily.

System Import Sets &gt; Administration &gt; Scheduled Imports.

[https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/task/t\_ScheduleADataImport.html](https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/task/t_ScheduleADataImport.html)