Hi
I'm not sure if I've fully understood your question, but if some of your attributes are too long to fit in the target dataset, you can use the SubstringExtractor to only use the first n characters.
David
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
# Change the value beneath
maxLengthValue = 20
# Template Function interface:
def shortenValues(feature):
   Â
    # Retrieve all attributenames of this feature
    attributes = feature.getAllAttributeNames()
  Â
    # loop through all attributes
    for cAttribute in attributes:
       Â
        # Make sure nothin is changed on the standard (hidden) fme variables
        if cAttribute 0:4] == 'fme_':
            continue
       Â
        # Get the value if this attribute
        value = feature.getAttribute(cAttribute)
        # Check if the value of this attribute is too long.
        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!
If you just want to check if the length of the string is too much, you could use a Tester transformer and use the function StringLength on the attribute. All failing features can be written to a Logger, Inspector or the output of your choice.
This will allow QA before writing to the ESRI database.