Hi All,
We had created this connection alias to connect to the database:
This is working well with the normal input tool, but if I use this within a Python code (see below screenshot) , it gives us an error. Do you know if there is a way to use this alias within Python code?
I don't know of any way to reference an Alteryx connection alias within a python tool. The alias is used by the Alteryx engine to get the connection details. Since the Python tool runs in a Jupyter Notebook environment, there's no way for the Jupyter environment to translate the alias into a connection string.
You have a few options to deal with this.
1. Retrieve the data within Alteryx and pass the data to the Python tool.
2. Define the connection string in Alteryx and pass it the python tool to pass as an argument to pyodbc.connect()
3. Hard code the connection string in the python code.
Dan