Hi Remco,
The SubstringExtractor would indeed be the way to go. However if you want to test multiple variables, then it might be more useful to use a PythonCaller, loop through all variables and shorten those that are too long. Below you can find an example.
import fme
import fmeobjects
maxLengthValue = 20
def shortenValues(feature):
attributes = feature.getAllAttributeNames()
for cAttribute in attributes:
if cAttribute[0:4] == 'fme_':
continue
value = feature.getAttribute(cAttribute)
if len(str(value)) > maxLengthValue:
feature.setAttribute(cAttribute, value[0:maxLengthValue])
The benefit of using Python over the SubstringExtractor is that you can generate a message in the log so you know a certain attribute is shortened and that you can shorten a lot of attributes with just one transformer.
Good luck!