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

Fetching substring in provisioning json

Prashant16
New Contributor III
New Contributor III

Hi Team,

I need assistance with extracting a specific part of a cp1 value and incorporating it into our JSON configuration.

Here’s the situation:

  • The Cp5 value we are working with is: "properties/3459917/accessBindings/AYVX2eztwoVBUS-Ae1dzgSyl-aW4t6Y="
  • We need to extract the last part of this value: "AYVX2eztwoVBUS-Ae1dzgSyl-aW4t6Y="

I need to use this extracted value in our JSON configuration
JSon 

{
"call": [
{
"name": "Accounts",
"connection": "userAuth",
"url": "https://analyticsadmin.googleapis.com/v1alpha/${Accounts.customproperty5}",
"httpMethod": "DELETE",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204
]
}
},
{
"name": "Properties",
"connection": "userAuth",
"url": "https://analyticsadmin.googleapis.com/v1alpha/${Accounts.customproperty5}",
"httpMethod": "DELETE",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204
]
}
}
]
}


3 REPLIES 3

NM
Honored Contributor II
Honored Contributor II

@Prashant16 try

account.customproperty5.split('/')[3]

Amit_Malik
Valued Contributor II
Valued Contributor II

Can you try below

${Accounts.customproperty5.split('\')[3]}

if that doesn't work, which could happen, then 

${Accounts.customproperty5.split('\\\\')[3]}

 

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".

rushikeshvartak
All-Star
All-Star
  • Instead of doing substring perform substring during import .

 

{
  "call": [
    {
      "name": "Accounts",
      "connection": "userAuth",
      "url": "https://analyticsadmin.googleapis.com/v1alpha/${accounts?.customproperty5.substring(accounts?.customproperty5.lastIndexOf('/') + 1)}",
      "httpMethod": "DELETE",
      "httpHeaders": {
        "Authorization": "${access_token}"
      },
      "httpContentType": "application/json",
      "successResponses": {
        "statusCode": [
          204
        ]
      }
    },
    {
      "name": "Properties",
      "connection": "userAuth",
      "url": "https://analyticsadmin.googleapis.com/v1alpha/${accounts?.customproperty5.substring(accounts?.customproperty5.lastIndexOf('/') + 1)}",
      "httpMethod": "DELETE",
      "httpHeaders": {
        "Authorization": "${access_token}"
      },
      "httpContentType": "application/json",
      "successResponses": {
        "statusCode": [
          204
        ]
      }
    }
  ]
}

 


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