Select to view content in your preferred language

Add multiple GDB to catalog in an ArcGISProject

686
4
Jump to solution
10-12-2022 02:30 PM
mattkramer
Frequent Contributor

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, 

1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Ah... Think you will need to do a Pro SDK configuration for that to happen.

View solution in original post

0 Kudos
4 Replies
by Anonymous User
Not applicable

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.

0 Kudos
mattkramer
Frequent Contributor

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. 

0 Kudos
by Anonymous User
Not applicable

Ah... Think you will need to do a Pro SDK configuration for that to happen.

0 Kudos
mattkramer
Frequent Contributor

Sounds good, thank you for the clarification! 

0 Kudos