ArcGIS Pro 3.0.2: How to make the “scratch workspace” environment as a parameter in the model?
I couldn’t figure out how to make the “scratch workspace” environment as a parameter in the model
Jamal - if you hover a 1-2 seconds over any input parameters in the Gas Station Vector model/tool, you'll see the full GDB path. It should be pointing to Default.gdb
My point here is that I need to make it as an option for the “end user”; the one who will be using the model without the need even to see its content. The end user needs to specify where to save the outputs based on his\her preferences. This means that the “scratch workspace” should appear in the main interface in order to browse to the required location
How this can be accomplished
So if I understand you correctly, you would like a user of the model to have a browse button at the end of each parameter so if they don't want the input/output to go to the scratch workspace that it goes (or comes from) somewhere else. Correct? If this is the case, then right-click on each tool and select create variable->from parameter. Identify the parameter of interest. Mark this as a model parameter. When you save and open the model the scratch workspace of default.gdb is there but NOW there's a browse button for each parameter to allow the user to identify another geodatabase input/output. Hope this makes sense.
I need the very end user to choose the “scratch workspace” for all the outputs exactly as we do with the environment tool AS PER THE SCREENSHOT BELOW
Okay - I understand what you're trying to do now. I believe I'm getting closer to a solution for you. In ModelBuilder, I went to the Insert group->Variable and chose "workspace" from the dropdown list. Then I double clicked the new variable and entered %scratchGDB% and clicked OK. Next I renamed the variable Scratch Workspace and marked it as parameter. Saved the model and ran the model. The result you can see below.
Related, in your graphic I saw are using the Feature Class to Feature Class GP tool, so another thought is to right-click the tool, select create variable->From Environment and choose "Current Workspace". Then open the blue variable and in the input box, type %scratchGDB%, click OK. Rename the variable Scratch Workspace.
I managed to implement the steps you have already provided. The outputs (green color) in the model appears not to respect the “scratch workspace” set in the “variable”.
Thx Jamal - yes, I too saw this after my initial post. There is a second one after the first with a slightly different workflow that "might" work. Have you tried that one too? Still working on this...
Could you please elaborate a bit more regarding what you mean by “second one after the first with a slightly different workflow”?