Hi @Jelle De Zwaef
As per the help document for FileAPI Writer
Data type Logical, bit, or boolean is not supported, thus the data get mapped as smallint(on writer), which can only accept integer values.
WORKAROUND
Use File Geodatabase(ArcObjects)writer (requires a valid Esri license)
To convert the data from True/False or Yes/No to 1/0 dynamically using Python
Using dynamic workflow since FME is not aware of the incoming attribute field names we need to use PythonCaller(thanks @debbiatsafe ). Please see the attached template as an example, it should convert all the incoming data type boolean to integers. If the incoming attribute does not contain attribute value, the code will map it to NULL.
Hi @Jelle De Zwaef
As per the help document for FileAPI Writer
Data type Logical, bit, or boolean is not supported, thus the data get mapped as smallint(on writer), which can only accept integer values.
WORKAROUND
Use File Geodatabase(ArcObjects)writer (requires a valid Esri license)
To convert the data from True/False or Yes/No to 1/0 dynamically using Python
Using dynamic workflow since FME is not aware of the incoming attribute field names we need to use PythonCaller(thanks @debbiatsafe ). Please see the attached template as an example, it should convert all the incoming data type boolean to integers. If the incoming attribute does not contain attribute value, the code will map it to NULL.
thank you very much @rahulsharma for your quick answer!
I still wonder a little bit why the booleans are converted to a smallint. Often (not always), the value will be true/false, which should be mapped to a string. If the data already contains 0/1, it could still be stored as a text (in contrast to storing text as smallint)
thank you very much @rahulsharma for your quick answer!
I still wonder a little bit why the booleans are converted to a smallint. Often (not always), the value will be true/false, which should be mapped to a string. If the data already contains 0/1, it could still be stored as a text (in contrast to storing text as smallint)
Hi @Jelle De Zwaef , The datatypes such as bit, logical or boolean for database stores the data as 0 or 1, but are displayed as True or False, Yes or No.
Background:
During translation, FME will do its best to automatically look at incoming data type and set the output to the closest possible. So in your translation, the incoming data is fme_boolean, thus it gets converted to fme_integer
If you do not want to store the data as an Integer data type, you can change the output (see below)
- On the Writer Feature type properties
- Switch to the "User Attribute" tab
- Under Attribute Definition, Click on Manual (Now you have unlocked that output attributes to be available for editing)
- For the attribute that you would like to change, for TYPE change from smallint/integer to text (width) or char(Based on the output format).