Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/18/2024 08:30 AM
Hi Team, We have a use case - while creating/inserting a new record into mysql database (DB connector) I need to check if user's displayname is more than 20 characters then I need to insert max upto 20 characters only. Please help to provide DB insert query syntax to limit username characters to 20.
09/18/2024 08:44 AM - edited 09/18/2024 10:10 AM
${user.displayname.substring(0, 20)}
09/18/2024 10:07 AM
@harishyara ${if (user.displayname.length>20){user.displayname.substring(0, 20)} else {user.displayname}}
09/18/2024 10:53 AM
Hello @NM - could you please help me on above condition using conditional operator ?
09/18/2024 11:01 AM
${user.displayname ? user.displayname.substring(0, 20) : null}
09/18/2024 10:56 AM
${(user.displayname.length>20)?user.displayname.substring(0, 20):user.displayname}
09/18/2024 11:27 AM
@NM - If I use above syntax getting this error: No such property: length for class: java.lang.String
09/18/2024 11:29 AM
${(user.displayname.length()>20)?user.displayname.substring(0, 20):user.displayname}
length is mysql
length() is java