Create a User Parameter to add database connection.
I am running a workspace with SDE readers and writers. It has designed to run on one market. I need to run the same workspace on other markets with a new database connection and I was wondering if I could set user parameters to input SDE connections and it will change data in feature readers accordingly.
I tried to create a user parameter that allows users to create a database connection, but it did not change the connections in Feature Reader. I still see my old connection.
If you created the user parameter inside the FeatureReader, it is likely the wrong type. It sounds like you want a Choice Parameter so you can simply select a new connection rather than having to search for the connection file each time. If you try creating the Choice Parameter from the Navigator > User Parameters > right click and manage user parameters, you should see more options for creating specific types of parameters. If you try a choice parameter, you can define the value (what is set in the FeatureReader) and display (what you see when the user parameter prompt appears). This will allow you to quickly and easily change between connection files. Pro tip, to quickly populate your display/value, you can use the import option and set the format to the PATH reader and point it to the directory containing all of the connection files: - I show how to do this with a directory of CSVs for example.
The default parameter type for the connection file is a file/url connection which requires users to go and point to the actual connection file before running the workspace. Still more convenient than digging into the transformer parameters to change it each time.
Another option if you prefer to use the default parameter type, you make use of Presets, it would be similar to creating a choice parameter but instead of applying to just one parameter, it would save all parameter values saved in the preset which may be useful if you also need to set the feature types to read parameter simultaneously: