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

REST - AccountEntImport

bhushan1
New Contributor III
New Contributor III

Hi All,

We have to update customproperty of the accounts with a value which is the part of a URL in the API response.

https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/emps/00020000000EACED000577080001...00040000000EACED00057708000110D9687632ABFFFFFFFFFFFFFFFF0000004AACED00057372000D6A6176612E73716C2E4461746514FA46683F3566970200007872000E6A6176612E7574696C2E44617465686A81014B597419030000787077080000019094CA3C0078
I am using below json where call4 is used for this purpose.
{
"accountParams": {
"createUsers": false,
"adminName": "admin",
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"accountThresholdValue": 1000,
"inactivateAccountsNotInFile": true,
"statusColumn": "customproperty11",
"correlateInactiveAccounts": true,
"activeStatus": [
"true"
],
"inactivateEntsNotInFeed": true
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://AAAAA.oraclecloud.com/hcmRestApi/scim/Users?startIndex=1&count=500",
"httpContentType": "application/json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"listField": "Resources",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"name": "userName~#~char",
"accountID": "id~#~char",
"displayname": "displayName~#~char",
"customproperty1": "name.givenName~#~char",
"customproperty2": "name.familyName~#~char",
"customproperty3": "emails.value~#~char",
"customproperty4": "#CONST#${String r1 = response?.'urn:scim:schemas:extension:fa:2.0:faUser'?.workerInformation?.personNumber; return r1}~#~char",
"customproperty11": "active~#~bool",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char",
"status": "active~#~char",
"created_on": "meta.created~#~date",
"updatedate": "meta.lastModified~#~date"
},
"makeProcessingStatus": true,
"pagination": {
"nextUrl": {
"nextUrlPath": "${response.completeResponseMap.itemsPerPage<500?null:'https://AAAAA.oraclecloud.com/hcmRestApi/scim/Users?startIndex='+Math.addExact(response.completeResp...}"
}
}
},
"call2": {
"callOrder": 1,
"stageNumber": 3,
"http": {
"url": "https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/userAccounts/${account.accountID}",
"httpContentType": "application/vnd.oracle.adf.resourceitem+json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"inputParams": {
"dependentCall": true
},
"listField": "",
"keyField": "accountID",
"nextApiKeyField": "accountID",
"colsToPropsMap": {
"accountID": "GUID~#~char",
"name": "Username~#~char",
"customproperty5": "PersonId~#~char"
}
},
"call3": {
"callOrder": 2,
"stageNumber": 6,
"http": {
"url": "https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/emps?q=PersonId=${account.customp...}",
"httpContentType": "application/vnd.oracle.adf.resourceitem+json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"inputParams": {
"dependentCall": true
},
"listField": "items",
"keyField": "customproperty5",
"nextApiKeyField": "customproperty5",
"colsToPropsMap": {
"name": "UserName~#~char",
"customproperty5": "PersonId~#~char",
"customproperty6": "#CONST#${response.links[0].href.substring(response.links[0].href.indexOf('emps') + 5)}~#~char"
}
},
"call4": {
"callOrder": 3,
"stageNumber": 8,
"http": {
"url": "https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/emps/${account.customproperty6}/c...",
"httpContentType": "application/vnd.oracle.adf.resourceitem+json",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
}
},
"inputParams": {
"dependentCall": true
},
"listField": "items",
"keyField": "customproperty6",
"nextApiKeyField": "customproperty6",
"colsToPropsMap": {
"customproperty6": "#CONST#${String href = response.links[0].href;int startIndex = href.indexOf('emps') + 5;int endIndex = href.indexOf('/', startIndex); return href.substring(startIndex, endIndex);}~#~char",
"customproperty41": "#CONST#${String href = response.links[0].href; int startIndex = href.indexOf('assignments') + 12; return href.substring(startIndex); }~#~char"
}
}
},
"acctEntMappings": {
"Roles": {
"listPath": "roles",
"idPath": "id",
"keyField": "entitlementID"
}
}
},
"entitlementParams": {
"processingType": "SequentialAndIterative",
"entTypes": {
"Roles": {
"entTypeOrder": 0,
"call": {
"call1": {
"connection": "acctAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://AAAAA.oraclecloud.com/hcmRestApi/scim/Roles?startIndex=1&count=500",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "Resources",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "id~#~char",
"entitlement_value": "name~#~char",
"displayName": "displayName~#~char",
"customproperty1": "id~#~char"
},
"pagination": {
"nextUrl": {
"nextUrlPath": "${response.completeResponseMap.itemsPerPage<500?null:'https://AAAAA.oraclecloud.com/hcmRestApi/scim/Roles?startIndex='+Math.addExact(response.completeResp...}"
}
},
"disableDeletedEntitlements": true
}
}
}
}
},
"acctEntParams": {
"processingType": "acctToEntMapping"
}
}
 
This json is not working and there is no error in the logs. Customproperty41 is not updated.
Until call3 the json is in PROD but with below change
"customproperty6": "#CONST#${response['links'][0].href.substring(response['links'][0].href.indexOf('emps') + 5)}~#~char"
 
If I am using the above code for customproperty6 in call3 in DEV and similar for call4 then it throws exception for 'links'
Can anyone help here?
 
Thanks,
Bhushan
2 REPLIES 2

rushikeshvartak
All-Star
All-Star
{
    "accountParams": {
        "createUsers": false,
        "adminName": "admin",
        "connection": "acctAuth",
        "processingType": "SequentialAndIterative",
        "statusAndThresholdConfig": {
            "accountThresholdValue": 1000,
            "inactivateAccountsNotInFile": true,
            "statusColumn": "customproperty11",
            "correlateInactiveAccounts": true,
            "activeStatus": ["true"],
            "inactivateEntsNotInFeed": true
        },
        "call": {
            "call1": {
                "callOrder": 0,
                "stageNumber": 0,
                "http": {
                    "url": "https://AAAAA.oraclecloud.com/hcmRestApi/scim/Users?startIndex=1&count=500",
                    "httpContentType": "application/json",
                    "httpMethod": "GET",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    }
                },
                "listField": "Resources",
                "keyField": "accountID",
                "statusConfig": {
                    "active": "true",
                    "inactive": "false"
                },
                "colsToPropsMap": {
                    "name": "userName~#~char",
                    "accountID": "id~#~char",
                    "displayname": "displayName~#~char",
                    "customproperty1": "name.givenName~#~char",
                    "customproperty2": "name.familyName~#~char",
                    "customproperty3": "emails.value~#~char",
                    "customproperty4": "#CONST#${String r1 = response?.'urn:scim:schemas:extension:fa:2.0:faUser'?.workerInformation?.personNumber; return r1}~#~char",
                    "customproperty11": "active~#~bool",
                    "customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char",
                    "status": "active~#~char",
                    "created_on": "meta.created~#~date",
                    "updatedate": "meta.lastModified~#~date"
                },
                "makeProcessingStatus": true,
                "pagination": {
                    "nextUrl": {
                        "nextUrlPath": "${response.completeResponseMap.itemsPerPage<500?null:'https://AAAAA.oraclecloud.com/hcmRestApi/scim/Users?startIndex='+Math.addExact(response.completeResp...}"
                    }
                }
            },
            "call2": {
                "callOrder": 1,
                "stageNumber": 3,
                "http": {
                    "url": "https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/userAccounts/${account.accountID}",
                    "httpContentType": "application/vnd.oracle.adf.resourceitem+json",
                    "httpMethod": "GET",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    }
                },
                "inputParams": {
                    "dependentCall": true
                },
                "listField": "",
                "keyField": "accountID",
                "nextApiKeyField": "accountID",
                "colsToPropsMap": {
                    "accountID": "GUID~#~char",
                    "name": "Username~#~char",
                    "customproperty5": "PersonId~#~char"
                }
            },
            "call3": {
                "callOrder": 2,
                "stageNumber": 6,
                "http": {
                    "url": "https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/emps?q=PersonId=${account.customproperty5}",
                    "httpContentType": "application/vnd.oracle.adf.resourceitem+json",
                    "httpMethod": "GET",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    }
                },
                "inputParams": {
                    "dependentCall": true
                },
                "listField": "items",
                "keyField": "customproperty5",
                "nextApiKeyField": "customproperty5",
                "colsToPropsMap": {
                    "name": "UserName~#~char",
                    "customproperty5": "PersonId~#~char",
                    "customproperty6": "#CONST#${response.links != null && response.links.size() > 0 ? response.links[0].href.substring(response.links[0].href.indexOf('emps') + 5) : null}~#~char"
                }
            },
            "call4": {
                "callOrder": 3,
                "stageNumber": 8,
                "http": {
                    "url": "https://AAAAA.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/emps/${account.customproperty6}/c...",
                    "httpContentType": "application/vnd.oracle.adf.resourceitem+json",
                    "httpMethod": "GET",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    }
                },
                "inputParams": {
                    "dependentCall": true
                },
                "listField": "items",
                "keyField": "customproperty6",
                "nextApiKeyField": "customproperty6",
                "colsToPropsMap": {
                    "customproperty6": "#CONST#${String href = response.links != null && response.links.size() > 0 ? response.links[0].href : null; int startIndex = href != null ? href.indexOf('emps') + 5 : -1; int endIndex = startIndex != -1 ? href.indexOf('/', startIndex) : -1; return startIndex != -1 && endIndex != -1 ? href.substring(startIndex, endIndex) : null;}~#~char",
                    "customproperty41": "#CONST#${String href = response.links != null && response.links.size() > 0 ? response.links[0].href : null; int startIndex = href != null ? href.indexOf('assignments') + 12 : -1; return startIndex != -1 ? href.substring(startIndex) : null;}~#~char"
                }
            }
        },
        "acctEntMappings": {
            "Roles": {
                "listPath": "roles",
                "idPath": "id",
                "keyField": "entitlementID"
            }
        }
    },
    "entitlementParams": {
        "processingType": "SequentialAndIterative",
        "entTypes": {
            "Roles": {
                "entTypeOrder": 0,
                "call": {
                    "call1": {
                        "connection": "acctAuth",
                        "callOrder": 0,
                        "stageNumber": 0,
                        "http": {
                            "httpHeaders": {
                                "Authorization": "${access_token}"
                            },
                            "url": "https://AAAAA.oraclecloud.com/hcmRestApi/scim/Roles?startIndex=1&count=500",
                            "httpContentType": "application/json",
                            "httpMethod": "GET"
                        },
                        "listField": "Resources",
                        "keyField": "entitlementID",
                        "colsToPropsMap": {
                            "entitlementID": "id~#~char",
                            "entitlement_value": "name~#~char",
                            "displayName": "displayName~#~char",
                            "customproperty1": "id~#~char"
                        },
                        "pagination": {
                            "nextUrl": {
                                "nextUrlPath": "${response.completeResponseMap.itemsPerPage<500?null:'https://AAAAA.oraclecloud.com/hcmRestApi/scim/Roles?startIndex='+Math.addExact(response.completeResp...}"
                            }
                        },
                        "disableDeletedEntitlements": true
                    }
                }
            }
        }
    },
    "acctEntParams": {
        "processingType": "acctToEntMapping"
    }
}

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

Hi @rushikeshvartak,

This json did not work. I could not find any errors or exceptions in the logs.

Thanks,
Bhushan