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

Import Pagination attributes in ImportAccountEntJSON

fuko
New Contributor III
New Contributor III

Hi Team,

We are trying to map totalAvailable attribute in pagination object to a customproperty of Accounts table. We used a second API call in accountParam to map them with accountID as key.

API response:

 

{
    "groups": {
        "group": [
            {
                "domain": {
                    "name": "local"
                },
                "id": "1234,
                "name": "Group A"
            },
            {
                "domain": {
                    "name": "local"
                },
                "id": "1234",
                "name": "Group B"
            }
        ]
    },
    "pagination": {
        "pageNumber": "1",
        "pageSize": "100",
        "totalAvailable": "2"
    }
}

 

Here is the accountParam snippet of ImportAccountEntJSON

 

"accountParams": {
      "connection": "userAuth",
      "createUsers": false,
      "adminName": "admin",
      "processingType": "SequentialAndIterative",
      "statusAndThresholdConfig": {
        "accountsNotInImportAction": "suspend",
        "accountThresholdValue": 300
      },
      "call": {
        "call1": {
          "callOrder": 0,
          "stageNumber": 0,
          "http": {
            "url": "https://******/users",
            "httpHeaders": {
              "Authorization": "${credentials.token}",
              "Accept": "application/json"
            },
            "httpContentType": "application/json",
            "httpMethod": "GET"
          },
          "listField": "users.user",
          "keyField": "name",
          "colsToPropsMap": {
            "accountID": "id~#~char",
            "name": "name~#~char",
            "customproperty2": "siteRole~#~char",
            "customproperty3": "lastLogin~#~char",
            "customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
          },
          "pagination": {
            "page": {
              "pageSizeParam": "pageSize",
              "pageSize": 1000,
              "pageNumberParam": "pageNumber",
              "totalCountPath": "completeResponseMap.pagination.totalAvailable"
            }
          },
          "disableDeletedAccounts": true
        },
        "call2": {
          "callOrder": 1,
          "stageNumber": 1,
          "http": {
            "url": "https://*******/users/${account.accountID}/groups",
            "httpHeaders": {
              "Authorization": "${credentials.token}",
              "Accept": "application/json"
            },
            "httpContentType": "application/json",
            "httpMethod": "GET"
          },
          "inputParams": {
            "dependentCall": true
          },
          "listField": "pagination",
          "keyField": "name",
          "nextApiKeyField": "accountID",
          "colsToPropsMap": {
            "customproperty22":"totalAvailable~#~int"
          },
          "pagination": {
            "page": {
              "pageSizeParam": "pageSize",
              "pageSize": 1000,
              "pageNumberParam": "pageNumber",
              "totalCountPath": "completeResponseMap.pagination.totalAvailable"
            }
          }
        }
      },
      "acctEntMappings": {
        "siteRole": {
          "importAsEntitlement": true,
          "listPath": "",
          "idPath": "siteRole",
          "keyField": "entitlementID",
          "colsToPropsMap": {
            "entitlement_value": "entitlement_value~#~char",
            "entitlementID": "entitlement_value~#~char"
          }
        }
      }
    },

 

Saviynt was able to call the API but got error when processing them.

Here is the log snippet:

"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Exception in persistAccounts:"
"2024-04-29T06:13:45.911+00:00","ecm-worker","","null-pg7pw","","java.lang.NullPointerException"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Invalid record not processed : [pageNumber:1, pageSize:100, totalAvailable:2]"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Exception in persistAccounts:"
"2024-04-29T06:13:45.911+00:00","ecm-worker","","null-pg7pw","","java.lang.NullPointerException"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Invalid record not processed : [pageNumber:1, pageSize:100, totalAvailable:3]"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Exception in persistAccounts:"
"2024-04-29T06:13:45.911+00:00","ecm-worker","","null-pg7pw","","java.lang.NullPointerException"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Invalid record not processed : [pageNumber:1, pageSize:100, totalAvailable:2]"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Exception in persistAccounts:"
"2024-04-29T06:13:45.911+00:00","ecm-worker","","null-pg7pw","","java.lang.NullPointerException"
"2024-04-29T06:13:45.509+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-9-pg7pw","ERROR","Invalid record not processed : [pageNumber:1, pageSize:100, totalAvailable:2]"
"2024-04-29T06:13:45.512+00:00","ecm-worker","services.ImportUtilityService","quartzScheduler_Worker-9-pg7pw","DEBUG","isImportSuccess: true"

Does anyone know how to resolve this issue?

1 REPLY 1

Raghu
Honored Contributor
Honored Contributor

@fuko  try below sytanx:

"pagination": {
"pageNumber": "1",
"pageSize": "100",
"totalAvailable": "2"
} -- to below

 

"pagination": {
"page": {
"pageSizeParam": "size",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.numberofElements",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.totalElements",
"firstPageNumber": 1
}
}

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.