Skip to content

Add migration from ServiceNow #1207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions pages/advanced-algorithms/available-algorithms/migrate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: Discover the migration capabilities of Memgraph for efficient trans
import { Cards } from 'nextra/components'
import GitHub from '/components/icons/GitHub'
import { Steps } from 'nextra/components'
import { Callout } from 'nextra/components';

# migrate

Expand Down Expand Up @@ -510,3 +511,46 @@ CALL migrate.s3('s3://my-bucket/employees.csv', {aws_access_key_id: 'your-key',
YIELD row
CREATE (e:Employee {id: row.id, name: row.name, position: row.position});
```

---

### `servicenow()`

With the `migrate.servicenow()` procedure, you can access [ServiceNow REST API](https://developer.servicenow.com/dev.do#!/reference/api/xanadu/rest/) and transfer your data to Memgraph.
The underlying implementation is using the [`requests` Python library] to migrate results to Memgraph. The REST API from
ServiceNow must provide results in the format `{results: []}` in order for Memgraph to stream it into result rows.

{<h4 className="custom-header"> Input: </h4>}

- `endpoint: str` ➡ ServiceNow endpoint. Users can optionally include their own query parameters to filter results.
- `config: mgp.Map` ➡ Connection parameters. Notable connection parameters are `username` and `password`, per `requests.get()` method.
- `config_path: str` ➡ Path to a JSON file containing configuration parameters.

{<h4 className="custom-header"> Output: </h4>}

- `row: mgp.Map` ➡ Each row from the CSV file as a structured dictionary.

{<h4 className="custom-header"> Usage: </h4>}

#### Retrieve and inspect CSV data from ServiceNow
```cypher
CALL migrate.servicenow('http://my_endpoint/api/data', {})
YIELD row
RETURN row
LIMIT 100;
```

#### Filter specific rows from the CSV
```cypher
CALL migrate.servicenow('http://my_endpoint/api/data', {})
YIELD row
WHERE row.age >= 30
RETURN row;
```

#### Create nodes dynamically from CSV data
```cypher
CALL migrate.servicenow('http://my_endpoint/api/data', {})
YIELD row
CREATE (e:Employee {id: row.id, name: row.name, position: row.position});
```