Hello,
I was wondering if there was a way to connect to multiple geodatabases in a project document, so they appear in the "Databases" dropdown in an ArcGIS Project file through Python. I know you can set the default database with the ArcGISProject.defaultGeodatabase property, but what if I wanted to add additional geodatabases beyond the default one?
Any input is appreciated!
Thanks,
Solved! Go to Solution.
Ah... Think you will need to do a Pro SDK configuration for that to happen.
You can do this by editing the Favorites JSON located in C:\Users\<username>\AppData\Roaming\Esri\ArcGISPro\Favorites\Favorites
Add an entry like the entries you have, selecting the persistFavorite to true for it so add to the Databases.
{
"TypeId": "database_fgdb",
"Path": "W:\\...\\...\\thebestgdbever.gdb",
"Id": "",
"url": null,
"name": "thebestgdbever.gdb",
"persistFavorite": true
}
You can do this python using json dumps and rewriting the json file.
I may be understanding the favorites incorrectly, but won't that only have the databases appear for that specific user, and also have it appear on all of their project files?
In my use case, I was hoping to get 2 databases connected to one project document, and then 2 different databases connected to another project document and so on. I also was hoping to do this for every user and not just an individual.
Ah... Think you will need to do a Pro SDK configuration for that to happen.
Sounds good, thank you for the clarification!