Skip to main content
Question

Write ESRI FGDB name dynamically


aaron
Contributor
Forum|alt.badge.img+10
  • Contributor

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

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 7, 2015

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.


aaron
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • December 7, 2015

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.


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • December 8, 2015
aaron wrote:

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!


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • December 9, 2015
aaron wrote:

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


Forum|alt.badge.img
  • June 28, 2016

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.


aaron
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • June 29, 2016

@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.


Forum|alt.badge.img
  • June 29, 2016
aaron wrote:

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings