Can I use a transform to transform “employeeid lastname,firstname.” to “Firstname Lastname (Employeeid)” ?
Yes you can use the combination of substring and concat. But you need to make sure you handle the possible errors when the input is not in the format you have specified
You can use Split transform using delimiter " " and “,” and then use concatenation to in Firstname Lastname (Employeeid) format to get the desired result.
Yes @aomololu you can transform the data to the format you mentioned.
Here’s a snippet of the transform that can help you achieve that.
{
"id": "76ba60e8-70fa-444f-9fa5-869469a370f3",
"name": "Display Name Transform",
"type": "static",
"attributes": {
"CurrentDisplayName": {
"type": "static",
"attributes": {
"value": "12134 Doe,Jhon"
}
},
"value": "#set($firstname=$CurrentDisplayName.split(',')[1])#set($part1=$CurrentDisplayName.split(',')[0])#set($lastname=$part1.split(' ')[1])#set($empid=$part1.split(' ')[0])$firstname $lastname ($empid)"
},
"internal": false
}
P.S as mentioned by above folks, in case your format changes, or there is any value not present then make the null checks accordingly.
There are other ways to achieve this i.e you can use split transform type, but as VTL supports split type i prefer this way.
Documentation for split type in sailpoint:Split | SailPoint Developer Community
Hope this can help…
Thanks everyone. The solutions and transform snippet worked. Transform is in production and is functioning accordingly.