Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/13/2024 02:34 AM
Hello,
In our Docebo REST integration we are importing branches as seen this ImportAccountEntJSON and using the branch code as the entitlement_value in Saviynt. The issue is that some branches don't have a code and are thus not imported to Saviynt. Is there a way to use the code if available, and if the code is blank to set the entitlement_value to 'code_' + the imported ID?
Here is our current AccountImportEntJSON and MODIFYUSERDATAJSON:
{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xxxxxxxxxxxx.docebosaas.com/manage/v1/user?page=1&page_size=100",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "data.items",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "user_id~#~char",
"name": "email~#~char",
"displayName": "fullname~#~char",
"customproperty2": "first_name~#~char",
"customproperty3": "last_name~#~char",
"customproperty4": "uuid~#~char",
"customproperty5": "is_manager~#~char",
"customproperty6": "username~#~char",
"customproperty7": "last_access_date~#~char",
"customproperty8": "last_update~#~char",
"customproperty9": "creation_date~#~char",
"customproperty10": "language~#~char",
"customproperty11": "lang_code~#~char",
"customproperty12": "expiration_date~#~char",
"customproperty13": "level~#~char",
"customproperty14": "email_validation_status~#~char",
"customproperty15": "send_notification~#~char",
"customproperty16": "encoded_username~#~char",
"customproperty17": "timezone~#~char",
"customproperty18": "date_format~#~char",
"customproperty19": "multidomains~#~char",
"customproperty20": "status~#~bool",
"customproperty21": "actions~#~char",
"customproperty22": "expired~#~char",
"customproperty31": "STORE#ACC#ENT#MAPPINGINFO~#~char"
},
"pagination": {
"page": {
"pageSizeParam": "page_size",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.data.current_page_size",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.data.total_count",
"FirstPageNumber": 1
}
}
}
}
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Group": {
"entTypeOrder": 1,
"entTypeLabels": {
},
"call": {
"call1": {
"connection": "acctAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xxxxxxxxxxxxxx.docebosaas.com/manage/v1/group?page=1&page_size=100",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "data.items",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "id~#~char",
"entitlement_value": "name~#~char",
"description": "description~#~char",
"customproperty1": "members_count~#~char",
"acctEntMappingInfoColumnFromEnt": "STORE#ACC#ENT#MAPPINGINFO~#~char"
},
"pagination": {
"page": {
"pageSizeParam": "page_size",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.data.current_page_size",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.data.total_count",
"FirstPageNumber": 1
}
},
"disableDeletedEntitlements": true
}
}
},
"Branch": {
"entTypeOrder": 2,
"entTypeLabels": {
},
"call": {
"call1": {
"connection": "acctAuth",
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xxxxxxxxxxxxxxxxx.docebosaas.com/manage/v1/orgchart?flattened=true&search_type=2&page=1&page_size=5",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "data.items",
"keyField": "entitlementID",
"colsToPropsMap": {
"entitlementID": "id~#~char",
"entitlement_value": "code~#~char",
"description": "title~#~char",
"customproperty1": "parent_code~#~char",
"customproperty2": "id~#~char",
"customproperty3": "parent_id~#~char",
"acctEntMappingInfoColumnFromEnt": "STORE#ACC#ENT#MAPPINGINFO~#~char"
},
"pagination": {
"page": {
"pageSizeParam": "page_size",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.data.current_page_size",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.data.total_count",
"FirstPageNumber": 1
}
},
"disableDeletedEntitlements": true
}
}
}
}
},
"acctEntParams": {
"connection": "acctAuth",
"entTypes": {
"Group": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "httpEntToAcct",
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://xxxxxxxxxxxxxxxxxx.docebosaas.com/manage/v1/group/${id}/members?page=1&page_size=5",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "data.items",
"entKeyField": "entitlementID",
"acctIdPath": "id",
"acctKeyField": "accountID",
"pagination": {
"page": {
"pageSizeParam": "page_size",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.data.current_page_size",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.data.total_count",
"FirstPageNumber": 1
}
}
}
}
},
"Branch": {
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"processingType": "httpEntToAcct",
"http": {
"httpHeaders": {
"Authorization": "${access_token}"
},
"url": "https://xxxxxxxxxxxxxxxxxx.docebosaas.com/manage/v1/orgchart/${id}/users?page=1&page_size=5",
"httpContentType": "application/json",
"httpMethod": "GET"
},
"listField": "data.items",
"entKeyField": "entitlementID",
"acctIdPath": "user_id",
"acctKeyField": "accountID",
"pagination": {
"page": {
"pageSizeParam": "page_size",
"pageSize": 100,
"pageRecordCount": "completeResponseMap.data.current_page_size",
"pageNumberParam": "page",
"totalCountPath": "completeResponseMap.data.total_count",
"FirstPageNumber": 1
}
}
}
}
}
}
}
}
{
"ADDITIONALTABLES": {
"ENTITLEMENT_VALUES" : "SELECT ENTITLEMENT_VALUE, CUSTOMPROPERTY2 FROM ENTITLEMENT_VALUES"
},
"COMPUTEDCOLUMNS": [
"ENTITLEMENT_VALUE","CUSTOMPROPERTY2"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET ENTITLEMENT_VALUE = CASE WHEN ENTITLEMENT_VALUE is null THEN CUSTOMPROPERTY2 ELSE ENTITLEMENT_VALUE END;"
]
}
Thank you,
Lukas
Solved! Go to Solution.
09/13/2024 03:59 AM - edited 09/13/2024 04:00 AM
1) MODIFYUSERDATAJSON is only used while importing users. It can't be used for account and ent import.
2) To check if code is null, see if below works
"entitlement_value": "#CONST#${String code = response.data.items.code; if (code == null) { return 'code_'+code} else {return code};}~#~char"
09/13/2024 04:12 AM - edited 09/13/2024 04:13 AM
Hi @Amit_Malik
Thank you for your response, unfortunately it seems like the code you provided does not get parsed, this is what I obtained:
Also the entitlements that were missing due to the lack of docebo code are still missing, the number of entitlements remained the same
09/13/2024 04:22 AM
@Lukas1 can you share postman response screenshot.
09/13/2024 05:20 AM
@NM
This is a sample of the postman response of the call we use to get the entitlements:
{
"id": "int",
"code": "Str",
"title": "Str",
"lev": "5",
"iLeft": "int",
"iRight": "int",
"parent_code": "Str",
"parent_id": "int",
"selection_status": 0,
"actions": [],
"has_children": false,
"selectable": 1,
"can_manage": true,
"icon": "Str",
"color": "",
"tooltip": ""
},
{
"id": "int",
"code": "",
"title": "Str",
"lev": "int",
"iLeft": "int",
"iRight": "int",
"parent_code": "Str",
"parent_id": "int",
"selection_status": 0,
"actions": [],
"has_children": false,
"selectable": 1,
"can_manage": true,
"icon": "Str",
"color": "",
"tooltip": ""
},
As you can see the code is sometimes empty so we are looking for a way to handle that. We could set the id as the entitlement value, but only if there is no way to set up a logic filter on the existence of the code.
These are elements contained in a list found as : {"data: {"items": [ <list of elems], "count":...}, "version":....}
09/13/2024 05:27 AM
Try below code with cp if worked then we will change for entitlement value
"customproperty7": "#CONST#${String op = response.data.items.id; String target = response.data.items.code; ret = op + \" \" + target; return ret}~#~char"
https://forums.saviynt.com/t5/identity-governance/rest-string-functions/m-p/9161#M1562
09/13/2024 05:45 AM
Still no luck, cp7 took it as a string literal:
09/13/2024 05:53 AM
Share postman screenshot for Ent type branch api with url/body/response
09/13/2024 05:59 AM
Url:
Body is empty, params are what you see in the url, and the response is this (with page size = 2 to keep it short):
{
"data": {
"items": [
{
"id": "<int>",
"code": "<Str>",
"title": "<Str>",
"lev": "4",
"iLeft": "<int>",
"iRight": "<int>",
"parent_code": "<Str>",
"parent_id": "<int>",
"selection_status": 0,
"actions": [],
"has_children": false,
"selectable": 1,
"can_manage": true,
"icon": "folder-outline",
"color": "",
"tooltip": ""
},
{
"id": "<int>",
"code": "<Str>",
"title": "<Str>",
"lev": "4",
"iLeft": "<int>",
"iRight": "<int>",
"parent_code": "<Str>",
"parent_id": "<int>",
"selection_status": 0,
"actions": [],
"has_children": false,
"selectable": 1,
"can_manage": true,
"icon": "folder-outline",
"color": "",
"tooltip": ""
}
],
"count": 2,
"has_more_data": true,
"cursor": null,
"current_page": 1,
"current_page_size": 2,
"total_page_count": 230,
"total_count": 460,
"sort": [
{
"sort_attr": "title",
"sort_dir": "asc"
},
{
"sort_attr": "id",
"sort_dir": "desc"
}
]
},
"version": "1.0.0",
"extra_data": {
"id": 0,
"code": "root",
"title": "Docebo",
"id_parent": 0,
"title_parent": "Docebo",
"lev": 1,
"iLeft": 1,
"iRight": 922,
"is_root": true,
"root_node_id": 0
},
"_links": []
}
09/13/2024 05:31 AM
@Lukas1 try this
"entitlement_value": "#CONST#${String code = response.data.items.code; if(code == '') { return 'code_'+code} else {return code}}~#~char"
09/13/2024 06:01 AM
Same problem as the customproperty7 suggestion, the code is interpreted literally
09/13/2024 06:02 AM
09/13/2024 06:13 AM
Still the same issue:
09/13/2024 06:18 AM
Can you share logs, make sure showlogs =true is enabled
09/13/2024 06:03 AM - edited 09/13/2024 06:18 AM
@Lukas1 try this should work
"entitlement_value": "#CONST#${String code = response.code; if(code == '') { return 'code_'+response.id} else {return code}}~#~char"
09/13/2024 06:47 AM - edited 09/13/2024 06:48 AM
Thank you so much that worked!
09/13/2024 06:04 AM
You need to do few trials with it
"entitlement_value": "#CONST#${String code = response.data.items.code; String ID = response.data.items.id; if (code == null ) {return \"Code _\" +ID} else {return code}}~#~char"