Hi Rich Harvey,
I do not personally have a ton of experience with the Tableau Desktop WDC but our Tableau Community page has an excellent forum section specifically for the WDC: Web Data Connector
Maybe (I'm sure of it) the community could better help you on this one.
I have struggled with the exact same question recently. I don't think there is any straight forward way of doing this because-
- "tableau.platformVersion" was added in sdk 2.1 and later. So for 2.0, there is no way to find the version. One workaround is to do something like "tableau.platformVersion === undefined ? '10.0' : tableau.platformVersion".
- "tableau.platformVersion" is only accessible if you have 'tableau' object which itself needs to be loaded first. So you have a chicken and egg problem.
- Tableau WDC window will throw an error if the SDK is higher version that that of the tableau desktop.
Having said that, you can probably do the following which is a really really dirty hack-
- load '2.1' sdk first, check tableau.platformVersion
- if tableau.platformVersion is undefined, then load 2.0 sdk
- otherwise, unload '2.1' sdk and then load appropriate tableau sdk