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

ImportAccountEntJSON in REST

Suresh1
New Contributor III
New Contributor III

Hello Team,

I'm trying to import the accounts from an application using a REST connector. Below is the my json and postman response is attached.

{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"accountThresholdValue": 2000,
"inactivateAccountsNotInFile": true
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https:<URL>",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "*/*"
}
},
"listField": "Resources",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "emails.value~#~char",
"customproperty1": "name.familyName~#~char",
"customproperty2": "name.givenName~#~char",
"customproperty3": "emails.value~#~char",
"customproperty4": "active~#~char",
"customproperty5": "displayName~#~char",
"status": "active~#~bool",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
},
"acctEntMappings": {
"Groups": {
"listPath": "groups",
"idPath": "value",
"keyField": "entitlementID"
}
}
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Groups": {
"entTypeOrder": 0,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "<URL>",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "*/*"
}
},
"listField": "Resources",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "id~#~char",
"entitlement_value": "displayName~#~char",
"customproperty1": "id~#~char"
}
}
}
}
}
},
"acctEntParams": {
"processingType": "acctToEntMapping"
}
}

 

Here i'm mapping accountname to email.value. so its fetching me accounts with user's email like below since it is in an array object.

[user.user@user.com]

Is there a way to eliminate [] symbols while importing ?

Regards,

Suresh V. 

 
 

 

 

 

 

3 REPLIES 3

Raghu
Valued Contributor III
Valued Contributor III

@Suresh1  can you update name below key and value try

"name": "#CONST#${String accName = emails.value; accName = accName.toString().replace('[','').replace(']',''); return accName}"

 

Raghu_0-1715186581994.png

 


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

rushikeshvartak
All-Star
All-Star
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"accountThresholdValue": 2000,
"inactivateAccountsNotInFile": true
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https:<URL>",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "*/*"
}
},
"listField": "Resources",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "id~#~char",
"name": "#CONST#${String accName = emails.value; accName = accName.toString().replace('[','').replace(']',''); return accName}"
"customproperty1": "name.familyName~#~char",
"customproperty2": "name.givenName~#~char",
"customproperty3": "emails.value~#~char",
"customproperty4": "active~#~char",
"customproperty5": "displayName~#~char",
"status": "active~#~bool",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
}
}
},
"acctEntMappings": {
"Groups": {
"listPath": "groups",
"idPath": "value",
"keyField": "entitlementID"
}
}
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Groups": {
"entTypeOrder": 0,
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "<URL>",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "*/*"
}
},
"listField": "Resources",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "id~#~char",
"entitlement_value": "displayName~#~char",
"customproperty1": "id~#~char"
}
}
}
}
}
},
"acctEntParams": {
"processingType": "acctToEntMapping"
}
}

 

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

Thank you all for your responses.

"name": "emails[0].value~#~char" This worked for me