According to several solved questions in this forum, there are two recommended ways to automatically remove attributes that only conatain NULL or empty values: using a small python script or using the NullAttributeMapper. Unfortunately both suggestions do not work for me (FME Desktop/Form 2022.2). Both the PythonCaller and the NullAttributeMapper keep the Null-Attributes and they are present when I write to Excel (see attached workspace). Is there something wrong in my workflow or is there an updated solution? Thanks for any suggestions!
Solved
Automatically remove unused attributes
Best answer by pflegpet
Hi @hkingsbury , thank you! Your modified Python code now removes all unused attributes. I also found out, that you could also use the SchemaScanner to achieve the same result (also using a dynamic writer). You just have to set it to "Ignore empty attributes" and exclude the schema attributes starting with fme_ (which is basically what you did in your script). I attached both solutions in case anyone needs this as a reference in the future.
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.