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

GCP REST connector account import error

Caesrob
Regular Contributor
Regular Contributor

We are trying to import accounts from our GCP using the rest connector. We followed the guide/documentation here: https://docs.saviyntcloud.com/bundle/GoolgeDrive-v23x/page/Content/Using-the-Connector-Service.htm

JSON:

{
    "accountParams": {
    "connection": "acctAuth",
    "processingType": "SequentialAndIterative",
    "call": {
    "call1": {
    "callOrder": 0,
    "stageNumber": 0,
    "http": {
    "url": "https://admin.googleapis.com/admin/directory/v1/users?customer=XXX",
    "httpMethod": "GET",
    "httpHeaders": {
    "Authorization": "${access_token}",
    "Accept": "application/json"
    },
    "httpContentType": "application/json"
    },
    "listField": "users",
    "colsToPropsMap": {
        "name": "primaryEmail~#~char",
        "displayName": "name.fullName~#~char",
        "accountID": "id~#~char",
        "customproperty3": "id~#~char"
    }
    }
    }
    }
}

We are getting the error:

Invalid record not processed. Error Message - Cannot invoke method trim() on null object. Total invalid records skipped: 3

The job is returning the amount of users in the API response, so that's good.

I'll add some of the API response here so you can see why the JSON is setup the way it is. Also, i'll add the complete logs in attachments.

API Response: 

{
    "kind": "admin#directory#users",
    "etag": "XXX",
    "users": [
        {
            "kind": "admin#directory#user",
            "id": "XXX",
            "etag": "XXX",
            "primaryEmail": "XXX",
            "name": {
                "givenName": "XXX",
                "familyName": "XXX",
                "fullName": "XXX"
            },
            "isAdmin": true,
            "isDelegatedAdmin": false,
            "lastLoginTime": "XXX",
            "creationTime": "XXX",
            "agreedToTerms": false,
            "suspended": false,
            "archived": false,
            "changePasswordAtNextLogin": false,
            "ipWhitelisted": false,
            "emails": [
                {
                    "address": "XXX",
                    "type": "XXX"
                },
                {
                    "address": "XXX",
                    "primary": XXX
                },
                {
                    "address": "XXX"
                }
            ],
            "languages": [
                {
                    "languageCode": "en",
                    "preference": "preferred"
                }
            ],
            "nonEditableAliases": [
                "XXX"
            ],
            "customerId": "XXX",
            "orgUnitPath": "/",
            "isMailboxSetup": false,
            "isEnrolledIn2Sv": false,
            "isEnforcedIn2Sv": false,
            "includeInGlobalAddressList": true
        }
}

 Some help with this would be appreciated.

5 REPLIES 5

SB
Saviynt Employee
Saviynt Employee

Are there a total of 3 records in the response or are there more number of record and we are getting error for only 3.

Can you update ConfigJSON param in the REST connection with value {"showLogs":true} and then run the job. This will print additional logs and may help identify the error.


Regards,
Sahil

Caesrob
Regular Contributor
Regular Contributor

Yes, there are a total of 3 records which should be imported so that's good.

"showLogs":true did not really add any more information to the job log:

Caesrob_0-1692176013198.png

 

SB
Saviynt Employee
Saviynt Employee

Can you update your JSON and add keyField as well like below

"listField": "users",
"keyField": "accountID",


Regards,
Sahil

Caesrob
Regular Contributor
Regular Contributor

Thank you, I don't know why but the "keyField": "accountID" fixed it!

SB
Saviynt Employee
Saviynt Employee

This is a required field to be defined in the JSON which lets the application know the key field value which is used to store the records in Saviynt. You may also call it the reconciliation field (which is a unique value).


Regards,
Sahil