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

Generate Entitlement displayname from entitlement_value on import job

fuko
New Contributor III
New Contributor III

Hi Team,

I want to modify the entiltlement_value string to create the displayname during import job. It would be something like this:

entitlement_value = "ABC_XYZ_View_Group" ---->  displayname = "ABC XYZ"

Is there any way I can modify the ImportAccEntJSON to do this? (regex, maybe?)

Here is the entitlement snippet of the JSON.

  "entitlementParams": {
    "processingType": "SequentialAndIterative",
    "connection": "userAuth",
    "entTypes": {
      "siteRole": {
        "entTypeOrder": 0
      },
      "group": {
        "entTypeOrder": 1,
        "call": {
          "call1": {
            "callOrder": 0,
            "stageNumber": 0,
            "http": {
              "url": "https://dummyurl/groups",
              "httpHeaders": {
                "Authorization": "${credentials.token}",
                "Accept": "application/json"
              },
              "httpContentType": "application/json",
              "httpMethod": "GET"
            },
            "listField": "groups.group",
            "keyField": "entitlementID",
            "colsToPropsMap": {
              "entitlementID": "id~#~char",
              "entitlement_value": "name~#~char"
            },
        "pagination": {
          "page": {
            "pageSizeParam": "pageSize",
            "pageSize": 1000,
            "pageNumberParam": "pageNumber",
            "totalCountPath": "completeResponseMap.pagination.totalAvailable"
          }
        },
 
            "disableDeletedEntitlements": true
          }
        }
      }
    }
  },

 

5 REPLIES 5

Saathvik
All-Star
All-Star

@fuko : Can you try below JSON

"entitlementParams": {
    "processingType": "SequentialAndIterative",
    "connection": "userAuth",
    "entTypes": {
        "siteRole": {
            "entTypeOrder": 0
        },
        "group": {
            "entTypeOrder": 1,
            "call": {
                "call1": {
                    "callOrder": 0,
                    "stageNumber": 0,
                    "http": {
                        "url": "https://dummyurl/groups",
                        "httpHeaders": {
                            "Authorization": "${credentials.token}",
                            "Accept": "application/json"
                        },
                        "httpContentType": "application/json",
                        "httpMethod": "GET"
                    },
                    "listField": "groups.group",
                    "keyField": "entitlementID",
                    "colsToPropsMap": {
                        "entitlementID": "id~#~char",
                        "entitlement_value": "name~#~char",
                        "displayname": "#CONST#${String attr = name;String out= attr.replaceAll(\"_\",\" \"); return out}~#~char"
                    },
                    "pagination": {
                        "page": {
                            "pageSizeParam": "pageSize",
                            "pageSize": 1000,
                            "pageNumberParam": "pageNumber",
                            "totalCountPath": "completeResponseMap.pagination.totalAvailable"
                        }
                    },
                    "disableDeletedEntitlements": true
                }
            }
        }
    }
}

 


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

rushikeshvartak
All-Star
All-Star
                        "displayname": "#CONST#${String attr = name;String out= attr.substring(0, attr.indexOf("_View_Group")).replaceAll(\"_\",\" \"); return out}~#~char"

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

fuko
New Contributor III
New Contributor III

Hi @rushikeshvartak , @Saathvik 

Instead of parsing the name the job seems to take the variable with code in it as a property.

I checked on both Entitlements UI and Data Analyzer

fuko_0-1713235839621.png                                    fuko_1-1713235937828.png

 

It should work

https://forums.saviynt.com/t5/identity-governance/rest-string-functions/m-p/9161#M1562

 

For your use case try below

"displayname": "#CONST#${String data1 = response.name; String data2 = response.name..replaceAll(\"_\",\" \"); ret = data2; return ret}~#~char"

 


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

fuko
New Contributor III
New Contributor III

Thanks @rushikeshvartak , @Saathvik 

The below JSON worked 👍. The text code will be use as property if there was error in code execution.

"entitlementParams": {
    "processingType": "SequentialAndIterative",
    "connection": "userAuth",
    "entTypes": {
      "siteRole": {
        "entTypeOrder": 0
      },
      "group": {
        "entTypeOrder": 1,
        "call": {
          "call1": {
            "callOrder": 0,
            "stageNumber": 0,
            "http": {
              "url": "https://dummyurl/groups",
              "httpHeaders": {
                "Authorization": "${credentials.token}",
                "Accept": "application/json"
              },
              "httpContentType": "application/json",
              "httpMethod": "GET"
            },
            "listField": "groups.group",
            "keyField": "entitlementID",
            "colsToPropsMap": {
              "entitlementID": "id~#~char",
              "entitlement_value": "name~#~char"
               "displayname": "#CONST#${String re = response.name; return re.replaceAll(\"View_Grp\",\"\").replaceAll(\"_\",\" \")}~#~char"
            },
        "pagination": {
          "page": {
            "pageSizeParam": "pageSize",
            "pageSize": 1000,
            "pageNumberParam": "pageNumber",
            "totalCountPath": "completeResponseMap.pagination.totalAvailable"
          }
        },
            "disableDeletedEntitlements": true
          }
        }
      }
    }
  },