You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to copy data from ServiceNow to supported sink data stores by using a copy activity in an Azure Data Factory or Synapse Analytics pipeline.
5
+
ms.author: jianleishen
6
+
author: jianleishen
7
+
ms.service: data-factory
8
+
ms.subservice: data-movement
9
+
ms.topic: conceptual
10
+
ms.custom: synapse
11
+
ms.date: 10/20/2023
12
+
---
13
+
14
+
# Copy data from ServiceNow using Azure Data Factory or Synapse Analytics
This article outlines how to use the Copy Activity in Azure Data Factory and Synapse Analytics pipelines to copy data from ServiceNow. It builds on the [copy activity overview](copy-activity-overview.md) article that presents a general overview of copy activity.
18
+
19
+
>[!IMPORTANT]
20
+
>The service has released a new ServiceNow connector which provides better native ServiceNow support, refer to [ServiceNow connector](connector-salesforce.md) article on details.
21
+
22
+
## Supported capabilities
23
+
24
+
This ServiceNow connector is supported for the following capabilities:
Use the following steps to create a linked service to ServiceNow in the Azure portal UI.
44
+
45
+
1. Browse to the Manage tab in your Azure Data Factory or Synapse workspace and select Linked Services, then click New:
46
+
47
+
# [Azure Data Factory](#tab/data-factory)
48
+
49
+
:::image type="content" source="media/doc-common-process/new-linked-service.png" alt-text="Create a new linked service with Azure Data Factory UI.":::
50
+
51
+
# [Azure Synapse](#tab/synapse-analytics)
52
+
53
+
:::image type="content" source="media/doc-common-process/new-linked-service-synapse.png" alt-text="Create a new linked service with Azure Synapse UI.":::
54
+
55
+
2. Search for ServiceNow and select the ServiceNow connector.
56
+
57
+
:::image type="content" source="media/connector-servicenow-legacy/servicenow-legacy-connector.png" alt-text="Select the ServiceNow connector.":::
58
+
59
+
1. Configure the service details, test the connection, and create the new linked service.
60
+
61
+
:::image type="content" source="media/connector-servicenow-legacy/configure-servicenow-legacy-linked-service.png" alt-text="Configure a linked service to ServiceNow.":::
62
+
63
+
## Connector configuration details
64
+
65
+
The following sections provide details about properties that are used to define Data Factory entities specific to ServiceNow connector.
66
+
67
+
## Linked service properties
68
+
69
+
The following properties are supported for ServiceNow linked service:
70
+
71
+
| Property | Description | Required |
72
+
|:--- |:--- |:--- |
73
+
| type | The type property must be set to: **ServiceNow**| Yes |
74
+
| endpoint | The endpoint of the ServiceNow server (`http://<instance>.service-now.com`). | Yes |
75
+
| authenticationType | The authentication type to use. <br/>Allowed values are: **Basic**, **OAuth2**| Yes |
76
+
| username | The user name used to connect to the ServiceNow server for Basic and OAuth2 authentication. | Yes |
77
+
| password | The password corresponding to the user name for Basic and OAuth2 authentication. Mark this field as a SecureString to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | Yes |
78
+
| clientId | The client ID for OAuth2 authentication. | No |
79
+
| clientSecret | The client secret for OAuth2 authentication. Mark this field as a SecureString to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | No |
80
+
| useEncryptedEndpoints | Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. | No |
81
+
| useHostVerification | Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over TLS. The default value is true. | No |
82
+
| usePeerVerification | Specifies whether to verify the identity of the server when connecting over TLS. The default value is true. | No |
83
+
84
+
**Example:**
85
+
86
+
```json
87
+
{
88
+
"name": "ServiceNowLinkedService",
89
+
"properties": {
90
+
"type": "ServiceNow",
91
+
"typeProperties": {
92
+
"endpoint" : "http://<instance>.service-now.com",
93
+
"authenticationType" : "Basic",
94
+
"username" : "<username>",
95
+
"password": {
96
+
"type": "SecureString",
97
+
"value": "<password>"
98
+
}
99
+
}
100
+
}
101
+
}
102
+
```
103
+
104
+
## Dataset properties
105
+
106
+
For a full list of sections and properties available for defining datasets, see the [datasets](concepts-datasets-linked-services.md) article. This section provides a list of properties supported by ServiceNow dataset.
107
+
108
+
To copy data from ServiceNow, set the type property of the dataset to **ServiceNowObject**. The following properties are supported:
109
+
110
+
| Property | Description | Required |
111
+
|:--- |:--- |:--- |
112
+
| type | The type property of the dataset must be set to: **ServiceNowObject**| Yes |
113
+
| tableName | Name of the table. | No (if "query" in activity source is specified) |
114
+
115
+
**Example**
116
+
117
+
```json
118
+
{
119
+
"name": "ServiceNowDataset",
120
+
"properties": {
121
+
"type": "ServiceNowObject",
122
+
"typeProperties": {},
123
+
"schema": [],
124
+
"linkedServiceName": {
125
+
"referenceName": "<ServiceNow linked service name>",
126
+
"type": "LinkedServiceReference"
127
+
}
128
+
}
129
+
}
130
+
```
131
+
132
+
## Copy activity properties
133
+
134
+
For a full list of sections and properties available for defining activities, see the [Pipelines](concepts-pipelines-activities.md) article. This section provides a list of properties supported by ServiceNow source.
135
+
136
+
### ServiceNow as source
137
+
138
+
To copy data from ServiceNow, set the source type in the copy activity to **ServiceNowSource**. The following properties are supported in the copy activity **source** section:
139
+
140
+
| Property | Description | Required |
141
+
|:--- |:--- |:--- |
142
+
| type | The type property of the copy activity source must be set to: **ServiceNowSource**| Yes |
143
+
| query | Use the custom SQL query to read data. For example: `"SELECT * FROM Actual.alm_asset"`. | No (if "tableName" in dataset is specified) |
144
+
145
+
Note the following when specifying the schema and column for ServiceNow in query, and **refer to [Performance tips](#performance-tips) on copy performance implication**.
146
+
147
+
-**Schema:** specify the schema as `Actual` or `Display` in the ServiceNow query, which you can look at it as the parameter of `sysparm_display_value` as true or false when calling [ServiceNow REST APIs](https://developer.servicenow.com/app.do#!/rest_api_doc?v=jakarta&id=r_AggregateAPI-GET).
148
+
-**Column:** the column name for actual value under `Actual` schema is `[column name]_value`, while for display value under `Display` schema is `[column name]_display_value`. Note the column name need map to the schema being used in the query.
ServiceNow has 2 different schemas, one is **"Actual"** which returns actual data, the other is **"Display"** which returns the display values of data.
191
+
192
+
If you have a filter in your query, use "Actual" schema which has better copy performance. When querying against "Actual" schema, ServiceNow natively support filter when fetching the data to only return the filtered resultset, whereas when querying "Display" schema, ADF retrieve all the data and apply filter internally.
193
+
194
+
### Index
195
+
196
+
ServiceNow table index can help improve query performance, refer to [Create a table index](https://docs.servicenow.com/bundle/quebec-platform-administration/page/administer/table-administration/task/t_CreateCustomIndex.html).
197
+
198
+
## Lookup activity properties
199
+
200
+
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
201
+
202
+
203
+
## Related content
204
+
For a list of data stores supported as sources and sinks by the copy activity, see [supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).
This article outlines how to use the Copy Activity in Azure Data Factory and Synapse Analytics pipelines to copy data from ServiceNow. It builds on the [copy activity overview](copy-activity-overview.md) article that presents a general overview of copy activity.
18
19
20
+
>[!IMPORTANT]
21
+
>The new ServiceNow connector provides improved native ServiceNow support. If you are using the legacy ServiceNow connector in your solution, supported as-is for backward compatibility only, refer to [ServiceNow connector (legacy)](connector-servicenow-legacy.md) article.
22
+
23
+
19
24
## Supported capabilities
20
25
21
26
This ServiceNow connector is supported for the following capabilities:
@@ -29,7 +34,7 @@ This ServiceNow connector is supported for the following capabilities:
29
34
30
35
For a list of data stores that are supported as sources/sinks, see the [Supported data stores](connector-overview.md#supported-data-stores) table.
31
36
32
-
The service provides a built-in driver to enable connectivity. Therefore you don't need to manually install any driver using this connector.
37
+
The service provides a built-in driver to enable connectivity. Therefore you don't need to manually install any driver using this connector.
33
38
34
39
## Getting started
35
40
@@ -67,24 +72,22 @@ The following properties are supported for ServiceNow linked service:
67
72
68
73
| Property | Description | Required |
69
74
|:--- |:--- |:--- |
70
-
| type | The type property must be set to: **ServiceNow**| Yes |
75
+
| type | The type property must be set to: **ServiceNowV2**| Yes |
71
76
| endpoint | The endpoint of the ServiceNow server (`http://<instance>.service-now.com`). | Yes |
72
77
| authenticationType | The authentication type to use. <br/>Allowed values are: **Basic**, **OAuth2**| Yes |
73
78
| username | The user name used to connect to the ServiceNow server for Basic and OAuth2 authentication. | Yes |
74
79
| password | The password corresponding to the user name for Basic and OAuth2 authentication. Mark this field as a SecureString to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | Yes |
75
-
| clientId | The client ID for OAuth2 authentication. | No |
76
-
| clientSecret | The client secret for OAuth2 authentication. Mark this field as a SecureString to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | No |
77
-
| useEncryptedEndpoints | Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. | No |
78
-
| useHostVerification | Specifies whether to require the host name in the server's certificate to match the host name of the server when connecting over TLS. The default value is true. | No |
79
-
| usePeerVerification | Specifies whether to verify the identity of the server when connecting over TLS. The default value is true. | No |
80
+
| clientId | The client ID for OAuth2 authentication. | Yes for OAuth authentication|
81
+
| clientSecret | The client secret for OAuth2 authentication. Mark this field as a SecureString to store it securely, or [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). | Yes for OAuth authentication |
82
+
| grantType | Specifies the type of OAuth2.0 flow that the client app uses to access token. The default value is password.| Yes for OAuth authentication |
80
83
81
84
**Example:**
82
85
83
86
```json
84
87
{
85
88
"name": "ServiceNowLinkedService",
86
89
"properties": {
87
-
"type": "ServiceNow",
90
+
"type": "ServiceNowV2",
88
91
"typeProperties": {
89
92
"endpoint" : "http://<instance>.service-now.com",
90
93
"authenticationType" : "Basic",
@@ -102,20 +105,20 @@ The following properties are supported for ServiceNow linked service:
102
105
103
106
For a full list of sections and properties available for defining datasets, see the [datasets](concepts-datasets-linked-services.md) article. This section provides a list of properties supported by ServiceNow dataset.
104
107
105
-
To copy data from ServiceNow, set the type property of the dataset to **ServiceNowObject**. The following properties are supported:
108
+
To copy data from ServiceNow, set the type property of the dataset to **ServiceNowV2Object**. The following properties are supported:
106
109
107
110
| Property | Description | Required |
108
111
|:--- |:--- |:--- |
109
-
| type | The type property of the dataset must be set to: **ServiceNowObject**| Yes |
110
-
| tableName | Name of the table. | No (if "query" in activity source is specified) |
112
+
| type | The type property of the dataset must be set to: **ServiceNowV2Object**| Yes |
113
+
| tableName | Name of the table. | No (if "expression" in activity source is specified) |
111
114
112
115
**Example**
113
116
114
117
```json
115
118
{
116
119
"name": "ServiceNowDataset",
117
120
"properties": {
118
-
"type": "ServiceNowObject",
121
+
"type": "ServiceNowV2Object",
119
122
"typeProperties": {},
120
123
"schema": [],
121
124
"linkedServiceName": {
@@ -132,27 +135,25 @@ For a full list of sections and properties available for defining activities, se
132
135
133
136
### ServiceNow as source
134
137
135
-
To copy data from ServiceNow, set the source type in the copy activity to **ServiceNowSource**. The following properties are supported in the copy activity **source** section:
138
+
To copy data from ServiceNow, set the source type in the copy activity to **ServiceNowV2Source**. The following properties are supported in the copy activity **source** section:
136
139
137
140
| Property | Description | Required |
138
141
|:--- |:--- |:--- |
139
-
| type | The type property of the copy activity source must be set to: **ServiceNowSource**| Yes |
140
-
| query | Use the custom SQL query to read data. For example: `"SELECT * FROM Actual.alm_asset"`. | No (if "tableName" in dataset is specified) |
142
+
| type | The type property of the copy activity source must be set to: **ServiceNowV2Source**| Yes |
143
+
| expression| Use the expression to read data. You can configure the expression in **Query builder**. | No (if "tableName" in dataset is specified) |
144
+
|*Under `expression`*|||
145
+
| type | The expression type. Values can be Constant (default), Unary, Binary, and Field. | No |
146
+
| value | The constant value. | Required when the expression type is Constant or Field |
147
+
| operators | The operator value. For more information about available operators, see [Supported operators](#supported-operators).| Required when the expression type is Unary or Binary |
148
+
| operands | List of expressions on which operator is applied.| Required when the expression type is Unary or Binary |
141
149
142
-
Note the following when specifying the schema and column for ServiceNow in query, and **refer to [Performance tips](#performance-tips) on copy performance implication**.
150
+
**Query builder** has the same usage as the condition builder in ServiceNow. For instructions on how to use it, see this [article](https://docs.servicenow.com/bundle/vancouver-platform-user-interface/page/use/common-ui-elements/concept/c_ConditionBuilder.html).
143
151
144
-
-**Schema:** specify the schema as `Actual` or `Display` in the ServiceNow query, which you can look at it as the parameter of `sysparm_display_value` as true or false when calling [ServiceNow REST APIs](https://developer.servicenow.com/app.do#!/rest_api_doc?v=jakarta&id=r_AggregateAPI-GET).
145
-
-**Column:** the column name for actual value under `Actual` schema is `[column name]_value`, while for display value under `Display` schema is `[column name]_display_value`. Note the column name need map to the schema being used in the query.
146
-
147
-
**Sample query:**
148
-
`SELECT col_value FROM Actual.alm_asset`
149
-
OR
150
-
`SELECT col_display_value FROM Display.alm_asset`
151
152
152
153
**Example:**
153
154
154
155
```json
155
-
"activities":[
156
+
"activities":[
156
157
{
157
158
"name": "CopyFromServiceNow",
158
159
"type": "Copy",
@@ -170,8 +171,7 @@ OR
170
171
],
171
172
"typeProperties": {
172
173
"source": {
173
-
"type": "ServiceNowSource",
174
-
"query": "SELECT * FROM Actual.alm_asset"
174
+
"type": "ServiceNowV2Source",
175
175
},
176
176
"sink": {
177
177
"type": "<sink type>"
@@ -180,6 +180,28 @@ OR
180
180
}
181
181
]
182
182
```
183
+
184
+
#### Supported operators
185
+
186
+
The supported operators in **Query builder** are shown in the table below:
187
+
188
+
| Operator name | Unary/Binary| Values required |
189
+
|:--- |:--- |:--- |
190
+
| is | Binary | low |
191
+
| isnot | Binary | low |
192
+
| contains | Binary | low |
193
+
| starts with | Binary | low |
194
+
| ends with | Binary | low |
195
+
| is empty | Unary | NIL |
196
+
| is not empty | Unary | NIL |
197
+
| before | Binary | Low |
198
+
| after | Binary | Low |
199
+
| does not contain | Binary | low |
200
+
| greater than | Binary | low |
201
+
| less than | Binary | low |
202
+
| is anything | Unary | NIL |
203
+
| between | Binary | Low and High |
204
+
183
205
## Performance tips
184
206
185
207
### Schema to use
@@ -196,6 +218,13 @@ ServiceNow table index can help improve query performance, refer to [Create a ta
196
218
197
219
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
198
220
221
+
## Upgrade your ServiceNow linked service
222
+
223
+
Here are the steps that help you to upgrade your ServiceNow linked service:
224
+
225
+
1. Create a new linked service by referring to [Linked service properties](linked-service-properties).
226
+
2.**Query** in source is changed to **Query builder**, which has the same usage as the condition builder in ServiceNow. Learn how to configure it referring to [ServiceNow as source](#servicenow-as-source) and [Condition builder](https://docs.servicenow.com/bundle/vancouver-platform-user-interface/page/use/common-ui-elements/concept/c_ConditionBuilder.html).
227
+
199
228
200
229
## Related content
201
230
For a list of data stores supported as sources and sinks by the copy activity, see [supported data stores](copy-activity-overview.md#supported-data-stores-and-formats).
0 commit comments