Question

Write ESRI FGDB name dynamically

  • 7 December 2015
  • 7 replies
  • 18 views

Badge +8

I would like to write the name of an ESRI file geodatabase (FGDB) at runtime based on the current date/time, for example C:\\Temp\\Output_20151207131034.gdb. How best to accomplish this? It's easy to do so with datasets and feature types but not the FGDB itself. Any suggestions would be appreciated.

Thanks,

Aaron


7 replies

Userlevel 2
Badge +12

You need to get the name of the FGDB as an attribute on the data.

Then you can use the Dataset Fanout which is in the Navigator properties for the Writer.

Badge +8

Thanks, worked like a charm in FME Desktop 2015.1.

I was using FME Desktop 2016 Beta (build 16140), which wouldn't save the fanout directory. It kept reverting to the initial FGDB folder so my output looked like C:\\Temp\\Output.gdb\\Output_<DateTimeStamp>.gdb. It's a minor bug since Output.gdb was treated as a "regular" folder with actually FGDBs inside it.

Userlevel 4
Badge +25

Thanks, worked like a charm in FME Desktop 2015.1.

I was using FME Desktop 2016 Beta (build 16140), which wouldn't save the fanout directory. It kept reverting to the initial FGDB folder so my output looked like C:\\Temp\\Output.gdb\\Output_<DateTimeStamp>.gdb. It's a minor bug since Output.gdb was treated as a "regular" folder with actually FGDBs inside it.

In 2016 I think when you set the fanout the directory field looks like this:

C:\\FMEData2016\\Output\\blah.gdb

You should remove the output.gdb part from that to leave it as a folder. Then the result will be what you expect. I've filed a request to change that field to a true folder (not a filename) - PR#66480

I also noticed you can just uncheck the fanout dataset box and then check it again to get the same result!

Userlevel 4
Badge +25

Thanks, worked like a charm in FME Desktop 2015.1.

I was using FME Desktop 2016 Beta (build 16140), which wouldn't save the fanout directory. It kept reverting to the initial FGDB folder so my output looked like C:\\Temp\\Output.gdb\\Output_<DateTimeStamp>.gdb. It's a minor bug since Output.gdb was treated as a "regular" folder with actually FGDBs inside it.

I just checked and it works correctly now in the latest 2016 beta (build 16145) so it'll be fine in the upcoming release

Badge

Hello...I'm trying to do what @aaron asked in his original question but I don't quite know how "to get the name of the FGDB as an attribute on the data". What I've done is used the TimeStamper transformer to create a _Date time stamp attribute, however, when I try and use this within the file gdb name [e.g. DED_AGOLBackup_@Value(_Date)], "@Value_(_Date)" get incorporated as part of the geodatabase name, not the date itself (see image). Thanks.

Badge +8

@aviveiro, you can use a StringConcatenator to create your FGDB name, putting the value from the TimeStamper at the end of the string. Then go to your FGDB in the Navigator; expand Parameters and then Advanced. Set Fanout Dataset to Yes and set Attribute To Fanout On to the attribute you created in StringConcatenator. Since all the values are the same, you will get one file geodatabase named from that value.

Badge

@aviveiro, you can use a StringConcatenator to create your FGDB name, putting the value from the TimeStamper at the end of the string. Then go to your FGDB in the Navigator; expand Parameters and then Advanced. Set Fanout Dataset to Yes and set Attribute To Fanout On to the attribute you created in StringConcatenator. Since all the values are the same, you will get one file geodatabase named from that value.

Worked...thanks @aaron. I've attached a screenshot of what I did.

fgdbnameimage.jpg

Reply