Skip to main content

Hi All,

I have created a workspace that reads all GDBs included in a folder (and subfolders) and export a few attributes to an excel file but now need to bring the GDB name (path_filename) into the final output. I tried to expose the attribute to bring it along the workflow but seems isn’t part of the unexposed attributes.

I was expecting to see the GDB name as part of the Generic elements (within the unexposed attributes) but the GDB is only in the <Schema>,

How can I bring the GDB name as column in the final output (excel file in this case)?

<Generic> screenshot

<Schema> Screenshot

 

You can get fme_basename or fme_dataset, but you have to dig in the FeatureReader’s settings to switch it on:

  • FeatureReader
    • Format = Esri Geodatabase (File Geodb)
    • Parameters…
      • Schema Attributes
        • Additional Attributes to Expose
          • fme_basename
          • fme_dataset
    • <Generic> Port
      • Attributes to Expose
        • fme_basename
        • fme_dataset

As an alternative, this is how I do it:

  • Creator
  • FeatureReader
    • Format = Directory and File Pathnames
    • Path Filter = *.gdb
    • Recurse Into Subfolders = Yes
  • Keeper
    • Attributes to Keep = path_windows
  • FeatureReader
    • Format = Esri Geodatabase (File Geodb)
    • Dataset = path_windows
    • Attribute and Geometry Handling
      • Accumulation Mode = Merge Initiator and Result

This merges path_windows to all features read by the second FeatureReader. If you only want the name, you can always use the FilenamePartExtractor to get it from path_windows, and you probably want to do this before the second FeatureReader.


Thanks @nielsgerrits - the ‘Accumulation Mode = Merge Initiator and Result’ did the trick :)


Reply