Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/13/2024 11:19 PM
Hi All,
In an application, I have the employeeName attribute value as "abcd/johnpatrick" and I need to bring it to the Account customproperty 9 as "johnpatrick" and need to remove the string before the "/" character.
What is the syntax I should use in the colsToPropsMap to get the substring after the character "/".
ImportAccountEntJSON (colsToPropsMap):
"colsToPropsMap":{
"accountID":"employeeId~#~char",
"name":"employeeName",
"status":"status~#~char",
"customproperty1":"userName~#~char",
"customproperty2":"emplClassCode~#~char",
"customproperty3":"tellerClassCode~#~char",
"customproperty4":"ptid~#~char",
"customproperty5":"status~#~char",
"customproperty6":"networkAcct~#~char",
"customproperty8":"employeeId~#~char",
"customproperty9":"#CONST#${LEFT(employeeName, CHARINDEX('/',employeeName) -1)}~#~char",
"customproperty31":"STORE#ACC#ENT#MAPPINGINFO~#~char"
},
I am getting the above syntax as same in the Account CustomProperty 9 as shown below:
What is the correct syntax to use?
Thanks & Regards,
SaviyntSavvy
05/14/2024 04:16 AM
@Saviynt_Savvy you can try below's
"customproperty9": "#CONST#${valueEmp = employeeName.indexOf('/'); valueEmp = employeeName.substring(valueEmp + 1); return valueEmp}"
or
"customproperty9": "#CONST#${valueEmp = employeeName.indexOf('/').substring(valueEmp + 1); return valueEmp}"
05/14/2024 05:22 AM
The syntax you are using in the colsToPropsMap for getting the substring after the "/" character is correct. However, it seems like the syntax is not working as expected in your case. One possible solution could be to use the SUBSTRING function along with the CHARINDEX function to get the desired substring.
You can try the following syntax for the customproperty9 mapping:
"customproperty9": "#CONST#${SUBSTRING(employeeName, CHARINDEX('/', employeeName) + 1, LEN(employeeName))}~#~char"
This syntax uses the SUBSTRING function to extract the substring after the "/" character by adding 1 to the index returned by the CHARINDEX function. The LEN function is also used to determine the length of the original string.
Please give this syntax a try and see if it gives you the desired result.
05/14/2024 05:30 AM
Its java functions not myql
"customproperty9":"#CONST#${response.employeeName?.substring(0, response.employeeName.indexOf('/') != -1 ? response.employeeName.indexOf('/') :response.employeeName.length())}
05/16/2024 10:27 PM
Hi @rushikeshvartak ,
Is the syntax going to be the same even in the case of backslash (\).
What if the name is "abcd\john" and need to import only the string "john".
Thanks & Regards,
SaviyntSavvy
05/16/2024 10:32 PM
Yes i have
"#CONST#${employeeName.split('\\\\')[0]}~#~char"
05/17/2024 12:14 AM
Hi @rushikeshvartak ,
It's reflecting as same in the customproperty as shown below.
Thanks & Regards,
SaviyntSavyy
05/17/2024 04:56 AM
@Saviynt_Savvy try below
"customproperty9": "${employeeName?.split('/')[1]}"
05/18/2024 06:08 AM
Typo mistake try below
"customproperty9": ""#CONST#${employeeName?.split('/')[1]}~#~char"
05/17/2024 05:00 AM
"#CONST#${response.employeeName.split('\\\\')[0]}~#~char"
05/22/2024 11:18 PM
Hi @rushikeshvartak ,
Still is just bringing the syntax into the Field, but not able bring the substring text.
Thanks & Regards,
SaviyntSavvy