Select to view content in your preferred language

Clearing custom workspace environment variables in Model Builder

271
3
09-17-2025 12:12 AM
LindsayRaabe_FPCWA
MVP Regular Contributor

In Model Builder, I want to clear custom Workspace variables in the Environment settings. 

To be clear, I want a model to run using whatever the default database/workspace of a given user is. 

The below screenshot shows a brand new model with a simple string variable in it) where I have Saved it without having touched the Environments. I then opened it and confirmed the pathways were pointing to my default gdb (as shown in the tool tip for Scratch Workspace). 

I then got a colleague to open the model and the Environments, and both pathways had changed to show her default geodatabase. I got her to manually enter a different pathway for the Current Workspace (%userprofile%\scratch.gdb) and save the model. I then reopened it and can see the updated Current Workspace pathway, but the Scratch one (left unchanged by my colleague) still reverted to my default gdb. 

How do I get the pathway that has been customised to go back to defaulting to the default gdb of any given user? Simply selecting the pathway and deleting it doesn't work - this just results in the current default in my project being put there and remaining hardwired for other users. 

LindsayRaabe_FPCWA_0-1758093129932.png

 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
3 Replies
JulianBenz
Emerging Contributor

I have run into this same problem. Except that in my case, I was trying to use utilize a model across many projects, each of which have a unique default geodatabase specific to the project.

My model is in my default geoprocessing toolbox. I do not change the default toolbox from project to project (so the referenced file for the tool stays the same). After figuring this out, I had to make absolutely sure that I did not change the environment workspace paths in the model, or else they would default to the workspace for the specific project I was working on and not change going forward when using the model in a different project.

I think an option should be added to allow the user whether to specific a specific workspace or just use the "default" workspace of the current project.

LindsayRaabe_FPCWA
MVP Regular Contributor

Thanks for adding your experience! Glad I'm not the only one. I think I'll have to add an Idea so that we can reverse this behaviour after applying it. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
LindsayRaabe_FPCWA
MVP Regular Contributor
0 Kudos