and more in a single search tool across platforms. Read the announcement here. |
05/12/2022 09:48 AM
Hi @ all!
version is: 2021.0
The AccountNameRule is set the following:
${Attribute1}_${Attribute2.substring(1,10)}###INCREMENTINDEX###
Backround is:
- Attribut2, if press "generate" shall be shortened, cause account-id should be not longer as "x"-chars in summary
Effect using .substring is, that u have to enter min 10 chars in the attribute field, otherwise substring can't count. so far clear.
What i'm looking for in the acc name rule is something like a syntax for "left" for attribute2 in the rule. to reduce up to 10 chars from the left. something like ${Attribute2.left...and then?!} (if its possible at all to use "left" or "len", "length" or .. ...)
Other option could be to reduce the possible input for attribute2 with regex to max. 10 chars in the template of the request. The thing is, it's from my point of view not comfortable for users, cause regex comes up with the error, if u submit, not if you put the data in. There might be some validation possibilities in the request template or in the dynamic attribute itself, kind of refresh, during the input by a user, but i didn't figured it out so far. And it's not possible, or it is?!, to define a qualified message for users, if regex runs into an error.
I would be nice, if someone has an hint for my topic.
Best regards!
Solved! Go to Solution.
05/12/2022 10:47 AM
Config :
ARS :
05/12/2022 11:04 AM
pardon, this was not the question
05/12/2022 06:41 PM
You may want to use the attribute in the following way in the rule:
${attr1?.length() > 10 ? attr1?.substring(0,10) : attr1}
This will take the full attribute value if the length is less than or equal to 10, otherwise will take only 10 characters.
05/13/2022 01:38 AM
Hi Amit,
thanks a lot, that works.
I have two questions.
Is there somewhere a documentation for the systematic behind syntax and possibilities. In a way with examples and declarations, what can be used, why and how?!
And, is it possible the use "replace substring" for the whole account generation, if users using in attr1 "blanks", this should be replaced with "_"?!
Thanks a lot!
05/13/2022 01:54 AM
These are generic Groovy expressions, so this is not something specific to Saviynt only. The Groovy expressions follow similar syntax as Java, hence based on the object, their methods can be invoked.
e.g., here attr1 is a String type of object, so methods like length, substring, replace, etc. can be used.
I recommend validating the Groovy expressions in an online IDE(e.g., Online Groovy Compiler - Online Groovy Editor - Run Groovy Online - Online Groovy Runner (jdoodle.co...) before using in Saviynt to get rid of syntactical errors.
For the replace method, you may use something like ${attr1.replaceAll(' ','_')}
05/13/2022 03:12 AM
Okay, thanks, I got it!
The whole works like this:
${Attribute1}_${Attribute2?.length() > 10 ? Attribute2.replaceAll(' ','_')?.substring(0,10) : Attribute2.replaceAll(' ','_')}###INCREMENTINDEX###
Thanks!!!!
12/15/2022 05:15 AM
Hi,
Could you tell me what does ###INCREMENTINDEX### do? Are you using Advanced Query? Can we have Increment Index in advanced query
12/15/2022 05:25 AM
Service account just have advance query