Looking for guidance if the below logic is possible within ISC transforms and what my problem might be below.
My VT logic is:
#if($persona != 'Student - MedEd' && $persona != 'Student - CPDP' && $psTitle != 'none')$psTitle
#elseif(($persona == 'Student - MedEd' || $persona == 'Student - CPDP') && $studentTitle != 'none')
#set($cleanedStudentTitle = $studentTitle.replaceAll('\\{\\}', '').replaceAll('\\}\\{', ', ').replaceAll('[{}]', ''))
#set($titleArray = $cleanedStudentTitle.split(', '))#set($titleSet = [])#foreach($title in $titleArray)
#if(!$titleSet.contains($title))#set($dummy = $titleSet.add($title))
#end
#end
#set($deduplicatedStudentTitle = $titleSet.join(', '))$deduplicatedStudentTitle#end"
The first set statement shows what I was writing out if the conditions were met. This all works if I only go up to the first set statement.
I run into errors once I try to do the additional logic used to remove duplicate values.
Example input:
{Sales Engineer}{Sales Engineer}{}{Interim Sales Manager}
Expected output would be:
Sales Engineer, Interim Sales Manager
It removes empty fields, replaces “}{” with ", " characters to allow splitting and an array to remove duplicates.
thanks,
Fred