Below transform will give me the job title correctly if the data coming from the source is say 1185-RN but if it is 9900-Student - Medical it doesn’t.{
"id": "c824fcad-c68c-4eda-8c79-35874ac43600", "name": "PROD_Split_JobTitle", "type": "static", "attributes": { "employeeType": { "type": "accountAttribute", "attributes": { "sourceName": "ARHPROD-Passport Database", "attributeName": "User_Type" } }, "jobTitle": { "type": "accountAttribute", "attributes": { "sourceName": "ARHPROD-Passport Database", "attributeName": "Title" } }, "value": "#set($jobTitle = $jobTitle)#if($jobTitle)#set($parts = $jobTitle.split(\\"-\\"))#if($parts.size() == 2)$parts.get(1).trim()#{else}$jobTitle#end#{else}\\"blank\\"#end" }, "internal": false}
It is not clear to me, could you give more detail on what you are trying to accomplish?
Hello, David. Hope you are doing great.
Not really sure on what you are trying to accomplish, but as per this transform looks like you want to get the last part or the first part after “-” of title attribute.
If so, you could try something like this below.
Last part of title (output would be “Medical”):
{
"id": "c824fcad-c68c-4eda-8c79-35874ac43600",
"name": "PROD_Split_JobTitle",
"type": "static",
"attributes": {
"employeeType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHPROD-Passport Database",
"attributeName": "User_Type"
}
},
"jobTitle": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHPROD-Passport Database",
"attributeName": "Title"
}
},
"value": "#set($jobTitle = $jobTitle)#if($jobTitle)#set($parts = $jobTitle.split(\"-\"))#if($parts.size() >= 2)$parts.get($parts.size() - 1).trim()#{else}$jobTitle#end#{else}\"blank\"#end"
},
"internal": false
}
First part after first “-” (output would be “Student”):
{
"id": "c824fcad-c68c-4eda-8c79-35874ac43600",
"name": "PROD_Split_JobTitle",
"type": "static",
"attributes": {
"employeeType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHPROD-Passport Database",
"attributeName": "User_Type"
}
},
"jobTitle": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHPROD-Passport Database",
"attributeName": "Title"
}
},
"value": "#set($jobTitle = $jobTitle)#if($jobTitle)#set($parts = $jobTitle.split(\"-\"))#if($parts.size() >= 2)$parts.get(1).trim()#{else}$jobTitle#end#{else}\"blank\"#end"
},
"internal": false
}
Hope it helps.
That works but I want the values after the first - so 9900-Student - Medical, I am wanting to get Student - Medical and set it as the job title
Can you please explain the issue more clearly. It is not clear with the explanation that you have written.
Thanks
Manish Singh
Hi David,
Good to know it works.
To get the “Student - Medical” you can use like this:
{
"id": "c824fcad-c68c-4eda-8c79-35874ac43600",
"name": "PROD_Split_JobTitle",
"type": "static",
"attributes": {
"employeeType": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHPROD-Passport Database",
"attributeName": "User_Type"
}
},
"jobTitle": {
"type": "accountAttribute",
"attributes": {
"sourceName": "ARHPROD-Passport Database",
"attributeName": "Title"
}
},
"value": "#set($jobTitle = $jobTitle)#if($jobTitle)#set($index = $jobTitle.indexOf(\"-\"))#if($index >= 0)$jobTitle.substring($index + 1).trim()#{else}$jobTitle#end#{else}\"blank\"#end"
},
"internal": false
}
Hope it helps.
I am trying to set the Job Title identity attribute. From the source it is tittle which includes the job code and title so 9900-Student - Medical, the job title should be Student - Medical and for say 1185-RN the job title should be RN and say I have Provider-OBGYN the title should still be Provider-OBGYN.