1

Every day I get a new geodatabase that I have to manually input in the shown ModelBuilder to produce a report. I would like to automate the input process, so the ModelBuilder would locate the new geodatabase from the computer download folder and use that as an input.

Does anyone have any solution?

Eventually, I want to make this model run itself every day at a certain time to produce a new report using the new geodatabase as an input.

enter image description here

4
  • 2
    Did you set as model parameter by right-clicking on "blue geodatabase circle"? Dec 18, 2021 at 0:27
  • You get new FGDBs daily, do they follow the same naming, are they overwritten or saved as a new GDB in your downloads? Also, you can look into the windows task scheduler as well as the similar task scheduler within ArcGIS Pro for auto-execution of the script. The easiest way is to call the model in in form of a toolbox in a python script, which looks into the workspace first and then proceeds with model execution. Dec 18, 2021 at 11:57
  • Thank you all for your kind help. The fGDB follows a specific naming convention. I download the new fGDB every day and put that into a specific folder with its older versions. Only the date in the name of the fGDB is changed every day. Also, yes I can schedule the model to run itself every day at a specific time. However, I would like the model to use the new fGDB that I downloaded in the regular folder to produce the output.
    – Raj
    Dec 20, 2021 at 18:12
  • You appear to have created two accounts. To avoid an editing experience that is frustrating to you, and those who try to help you, please follow these instructions to merge them: gis.stackexchange.com/help/merging-accounts
    – PolyGeo
    Dec 20, 2021 at 19:41

1 Answer 1

0

Add a 'Calculate Value' item to the model (ribbon -> 'Model Builder' -> 'Utilities' -> 'Calculate Value').

In the 'Calculate Value' item, write a Python script which outputs the path to the new fGDB as the resulting value. Set the 'Data Type' to 'Workspace'.

Link output value of the 'Calculate Value' item as the input to the existing 'Select Data` item.

Unless you provide more information in the question, I can't provide any specific help with how to write the Python script. Ie, only you know how to decide what the path to the new fGDB would be. Eg, perhaps it is the only folder with a '.gdb' filename extension, or perhaps is the the most recent one, or perhaps it has a specific name, etc, etc.

1
  • The fGDB follows a specific naming convention. I download the new fGDB every day and put that into a specific folder with its older versions. Only the date in the name of the fGDB is changed every day. Also, yes I can schedule the model to run itself every day at a specific time. However, I would like the model to use the most recent fGDB that I downloaded in the regular folder to produce the output. I would highly appreciate your help in writing a python script that can export Data Type to Workspace.
    – Raj
    Dec 27, 2021 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.