Excel Writer - Multiple inputs - multiple sheets - different attributes per sheet
I have a FME workspace reader that reads in the various attributes of a particular workbench and want to send the results to an excel spreadsheet with one sheet per feature. Each feature has a different set of attributes and can’t figure out how to get each sheet to be only the attributes of that feature.
Do I just need to have a separate reader for each feature_type or is there a way to channel all features into a single reader?
Page 1 / 1
Yes, you just need to have a separate reader for each feature_type.
You’re pretty close, you need to transition the process to a dynamic workspace as your schema changes across each feature type.
To do this you need two things, a schema feature, and your writer setup to accept that.
Thankfully, there is the SchemaScanner and this does most of the hardwork for you. You only need to make one change to it from its default state, that is setting group by to fme_feature_type
This then outputs a schema for each group of feature types, then connect both output ports to your excel writer.
In your writer, you will need to enable Dynamic Schema Definition and se the schema source to Schema From Schema Feature. In the User and Format Attributes tabs, make sure to unselect all rows and check that Attribute Definition is set to Dynamic.
The resulting workspace will look something like:
And your output Excel file with have a separate tab for each FeatureType with the correct attributes in each
Thank you @aurorarosalie that is the path I went down to get a result but a big shout out to @hkingsbury for an elegant result.
To get it to work perfectly, I will need to do some additional attribute checks as Excel has some row and width restrictions.