Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

REST connection: MODIFYUSERDATAJSON to edit imported entitlements

Lukas1
New Contributor
New Contributor

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

16 REPLIES 16

Amit_Malik
Valued Contributor II
Valued Contributor II

@Lukas1 

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"

 

 

Kind Regards,
Amit Malik
If this helped you move forward, please click on the "Kudos" button.
If this answers your query, please select "Accept As Solution".

Lukas1
New Contributor
New Contributor

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:

Lukas1_0-1726225884547.png

Also the entitlements that were missing due to the lack of docebo code are still missing, the number of entitlements remained the same

 

NM
Honored Contributor II
Honored Contributor II

@Lukas1 can you share postman response screenshot.

Lukas1
New Contributor
New Contributor

@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":....}

 

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


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Still no luck, cp7 took it as a string literal:

Lukas1_0-1726231531494.png

 

Share postman screenshot for Ent type branch api with url/body/response


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Url:

Lukas1_0-1726232181017.png

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": []
}

 

 

 

NM
Honored Contributor II
Honored Contributor II

@Lukas1 try this 

"entitlement_value": "#CONST#${String code = response.data.items.code; if(code == '') { return 'code_'+code} else {return code}}~#~char"

Lukas1
New Contributor
New Contributor

Same problem as the customproperty7 suggestion, the code is interpreted literally

  • "customproperty7": "#CONST#${String op = response.data.items; String target = response.data.items.code; ret = op + \" \" + target; return op}~#~char"

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Still the same issue:

Lukas1_0-1726233199569.png

 

Can you share logs, make sure showlogs =true is enabled


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

@Lukas1 try this should work 

"entitlement_value": "#CONST#${String code = response.code; if(code == '') { return 'code_'+response.id} else {return code}}~#~char"

Lukas1
New Contributor
New Contributor

Thank you so much that worked!

Amit_Malik
Valued Contributor II
Valued Contributor II

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"

 

Kind Regards,
Amit Malik
If this helped you move forward, please click on the "Kudos" button.
If this answers your query, please select "Accept As Solution".