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

Split entitlement value and send in REST URL

RV
Regular Contributor
Regular Contributor

Can someone please provide a syntax to split an entitlement value by Tilde and send the first token it in a REST URL.

Entitlement Value : IGA~admin

Instead of sending the entire entitlementValue, I need to pass only "IGA" by splitting the string by ~ and sending the first token.

{

      "name": "Team",

      "connection": "acctAuth",

      "url": https://api.github.com/orgs/${entitlementValue}/memberships/${account.name},

2 REPLIES 2

Hemanath
Saviynt Employee
Saviynt Employee

@RV 

Try with below one

"https://api.github.com/orgs/${String ev=entitlementValue;String[] evArray=ev.split(\"~\");return java.net.URLEncoder.encode(evArray[0],java.nio.charset.StandardCharsets.UTF_8.toString())}/memberships/${account.name}"

Thanks,

Hemanath J

If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

adriencosson
Valued Contributor
Valued Contributor

Hi @RV ,

You can try the below sample :

${entitlementValue.entitlement_value.substring(0,entitlementValue.entitlement_value.indexOf('~'))}

Hope this helps !

Regards,
Adrien COSSON