1 of 1 people found this helpful
Are you using two separate datasources or one multiple-connection datasource?
If it's the first one, you would need to loop through a process to change the datasource connection multiple times.
If it's the second one, when you query the datasource object each connection would be stored in a list format (e.g. connections and connections) so you would loop through each of those connection definitions.
Using the example script (I assume from document-api-python/replicate_workbook.py at master · tableau/document-api-python · GitHub), changing the datasources to datasources would get you the next datasource in the workbook. Changing connections to connections would get you the second connection definition if the datasource is a multiple connection datasource. From there you can update the server, port, username, pw, etc.
sourceWB.datasources.connections.server = row['Server']
Thanks for the reply Logan!
This solution worked great! I did not know the "datasources[*]" could be changed, thanks a bunch!