Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Need help to set pagination for account import using rest connector

Bhargavi3
New Contributor
New Contributor

Hi Team,

 

we are trying to import accounts from target application (ServiceNow) using rest connector. Able to import records as I tried by giving limit in the url (https://url/sys_user?sysparm_limit=1600). Now I am trying to import all accounts from target application. From postman also, we are able to fetch accounts with limit. Please find the below screenshots from postman.

Bhargavi3_0-1711091348074.png

If I try by removing limit, we are getting below error from postman.

Bhargavi3_0-1711092161433.png

 

 

I tried by giving pagination Json which was provided by rest connector guide. Nothing worked.

Could someone help me to import all users from target application?

 

ImportAccjson :

 

{
"accountParams": 
{
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"call": 
{
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": 
{
"httpHeaders": 
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpMethod": "GET"
},
"statusConfig": 
{
"active": "true",
"inactive": "false"
},
"listField": "result",
"keyField": "accountID",
"colsToPropsMap": 
{
"name": "user_name~#~char",
"accountID": "employee_number~#~char",
"status":"active~#~char",
"customproperty1":"email~#~char",
"customproperty2":"country~#~char",
"customproperty3":"sys_id~#~char",
"customproperty4":"gender~#~char",
"customproperty5":"city~#~char",
"customproperty6":"first_name~#~char",
"customproperty7":"last_name~#~char",
"customproperty8":"u_employment_category~#~char",
"customproperty9":"street~#~char",
"customproperty10":"u_preferred_name~#~char",
"customproperty11":"u_preferred_first_name~#~char",
"customproperty12":"u_preferred_last_name~#~char",
"customproperty13":"locked_out~#~char",
"customproperty14":"federated_id~#~char",
"customproperty15":"title~#~char",
"customproperty16":"edu_status~#~char",
"customproperty17":"u_compensation_grade~#~char",
"customproperty18":"last_login~#~char",
"customproperty19":"zip~#~char",
"customproperty20":"vip~#~char"
},
"pagination": {
"offset": {
"offsetParam": "startAt",
"sysparm_limit": "maxResults",
"batchSize": 100,
"totalCountPath": "xxxx"
}
}
 
}
}
}
}

Thanks,

Bhargavi Padaraju.

 

3 REPLIES 3

Manu269
All-Star
All-Star

@Bhargavi3 refer below :

{
"globalSettings": {
"userSourceList": [
"ALL"
]
},
"accountParams":{
"connection":"ServiceNow",
"processingType":"SequentialAndIterative",
"call":{
"call1":{
"callOrder":0,
"stageNumber":0,
"http":{
"url":"https://XXXX.service-now.com/api/now/table/sys_user?sysparm_query=active=true&sysparm_exclude_refere...",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/x-www-form-urlencoded",
"httpMethod":"GET"
},
"statusConfig":{
"active":"true",
"inactive":"false"
},
"listField":"result",
"keyField":"accountID",
"colsToPropsMap":{
"CUSTOMPROPERTY1": "employee_number~#~char",
"CUSTOMPROPERTY2": "name~#~char",
"CUSTOMPROPERTY3": "last_name~#~char",
"CUSTOMPROPERTY4": "email~#~char",
"CUSTOMPROPERTY5": "department~#~char",
"CUSTOMPROPERTY6": "location~#~char",
"CUSTOMPROPERTY7": "first_name~#~char",
"CUSTOMPROPERTY8": "manager~#~char",
"CUSTOMPROPERTY9": "country~#~char",
"CUSTOMPROPERTY10": "phone~#~char",
"CUSTOMPROPERTY11": "title~#~char",
"CUSTOMPROPERTY12": "active~#~char",
"CUSTOMPROPERTY13": "sys_updated_on~#~char",
"CUSTOMPROPERTY14": "sys_created_on~#~char",
"CUSTOMPROPERTY15": "last_login_time~#~char",
"creator": "sys_created_by~#~char",
"displayName": "name~#~char",
"name": "user_name~#~char",
"lockedState": "#CONST#${String isActive= response.active; isActive = (isActive.equals('true')) ? 2:1; return isActive}~#~char",
"status": "active~#~char",
"accountID": "sys_id~#~char"
},
"pagination":{
"nextUrl":{
"nextUrlPath":"${headers?.Link?.split(',')?.size()==4?headers?.Link?.split(',')[2]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():headers?.Link?.split(',')?.size()==3?headers?.Link?.split(',')[1]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():null}"
}
}
}
}
},
"entitlementParams":{
"processingType":"SequentialAndIterative",
"entTypes":{
"Group":{
"entTypeOrder":0,

"call":{
"call1":{
"connection":"ServiceNow",
"callOrder":0,
"stageNumber":0,
"http":{
"httpHeaders":{
"Authorization":"${access_token}"
},
"url":"https://XXXX.service-now.com/api/now/table/sys_user_group?sysparm_exclude_reference_link=true&syspar...",
"httpContentType":"application/json",
"httpMethod":"GET"
},
"listField":"result",
"keyField":"entitlementID",
"colsToPropsMap":{
"entitlementID": "sys_id~#~char",
"description": "description~#~char",
"entitlement_glossary": "description~#~char",
"entitlement_value": "name~#~char",
"status": "active~#~char",
"customproperty2": "manager~#~char",
"updatedate": "sys_updated_on~#~date",
"createdate": "sys_created_on~#~date",
"displayname": "name~#~char",
"acctEntMappingInfoColumnFromEnt": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
},
"entOwnerMappings": {
"listField": "",
"idPath": "manager",
"keyField": "customproperty11"
},
"entMappings":{
"Group":{
"listPath":"parent",
"idPath":"value",
"idColumn":"entitlementID",
"mappingTypes":[
"ENTMAP"
]
}
}
},
"Roles":{
"entTypeOrder":1,
"entTypeLabels":{

},
"call":{
"call1":{
"connection":"ServiceNow",
"callOrder":0,
"stageNumber":0,
"http":{
"httpHeaders":{
"Authorization":"${access_token}"
},
"url":"https://XXXX.service-now.com/api/now/table/sys_user_role",
"httpContentType":"application/json",
"httpMethod":"GET"
},
"listField":"result",
"keyField":"entitlementID",
"colsToPropsMap":{
"description":"description~#~char",
"customproperty3":"elevated_privilege~#~char",
"entitlementID":"sys_id~#~char",
"entitlement_Value":"name~#~char",
"displayname":"sys_name~#~char"
}
}
}
}
}
},
"acctEntParams":{
"entTypes":{
"Group":{
"call":{
"call1":{
"callOrder": 0,
"stageNumber": 0,
"processingType":"http",

"connection":"ServiceNow",
"http":{
"url":"https://XXXX.service-now.com/api/now/v1/table/sys_user_grmember",
"httpContentType":"application/json",
"httpMethod":"GET",
"httpHeaders":{
"Authorization":"${access_token}"
}
},
"listField":"result",
"acctKeyField":"accountID",
"entKeyField":"entitlementID",
"acctIdPath":"user.value",
"entIdPath":"group.value"
},
"call2": {
"connection": "ServiceNow",
"callOrder": 1,
"stageNumber": 1,
"showJobHistory": true,
"processingType": "entToAcctMapping",
"ownerKeyField": "customproperty11"
}
}
},
"Roles":{
"call":{
"call1":{
"processingType":"http",
"connection":"ServiceNow",
"http":{
"url":"https://XXXX.service-now.com/api/now/table/sys_user_has_role",
"httpContentType":"application/json",
"httpMethod":"GET",
"httpHeaders":{
"Authorization":"${access_token}"
}
},
"listField":"result",
"acctKeyField":"accountID",
"entKeyField":"entitlementID",
"acctIdPath":"user.value",
"entIdPath":"role.value"
}
}
}
}
}
}

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

Bhargavi3
New Contributor
New Contributor

@Manu269 ,  thanks for the response.

I tried by using the above code,but did not work. As of now I am trying to import only accounts.
I did not provide any limit in the url. Job ran sucessfully for 30 sec, but no accounts got imported.

 

{
"accountParams":
{
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"call":
{
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http":
{
"url": "https://url/sys_user",
"httpHeaders":
{
"Authorization":"${access_token}",
"Accept":"*/*"
},
"httpMethod": "GET"
},
"statusConfig":
{
"active": "true",
"inactive": "false"
},
"listField": "result",
"keyField": "accountID",
"colsToPropsMap":
{
"name": "user_name~#~char",
"accountID": "employee_number~#~char",
"status":"active~#~char",
"customproperty1":"email~#~char",
"customproperty2":"country~#~char",
"customproperty3":"sys_id~#~char",
"customproperty4":"gender~#~char",
"customproperty5":"city~#~char",
"customproperty6":"first_name~#~char",
"customproperty7":"last_name~#~char",
"customproperty8":"u_employment_category~#~char",
"customproperty9":"street~#~char",
"customproperty10":"u_preferred_name~#~char",
"customproperty11":"u_preferred_first_name~#~char",
"customproperty12":"u_preferred_last_name~#~char",
"customproperty13":"locked_out~#~char",
"customproperty14":"federated_id~#~char",
"customproperty15":"title~#~char",
"customproperty16":"edu_status~#~char",
"customproperty17":"u_compensation_grade~#~char",
"customproperty18":"last_login~#~char",
"customproperty19":"zip~#~char",
"customproperty20":"vip~#~char"
},
"pagination":{
"nextUrl":{
"nextUrlPath":"${headers?.Link?.split(',')?.size()==4?headers?.Link?.split(',')[2]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():headers?.Link?.split(',')?.size()==3?headers?.Link?.split(',')[1]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():null}"
}
}
}
}
}
}

Please Correct me if I missed anything in the Json.

Thanks,

Bhargavi.

rushikeshvartak
All-Star
All-Star

"pagination":{
"nextUrl":{
"nextUrlPath":"${headers?.Link?.split(',')?.size()==4?headers?.Link?.split(',')[2]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():headers?.Link?.split(',')?.size()==3?headers?.Link?.split(',')[1]?.replace('<', '')?.replace('>;rel=\"next\"','')?.trim():null}"
}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.