Issue got resolved after using ['dept-id'] instead of dept-id in for loop.But now getting a different issue i.e webdataconnector which i developed is based on latest webdataconnector sdk but client is using Tableau 9.3 which is not compatible with latest webdataconnector for that version i need wdc1.1.1. but i have already developed it with wdc2.3.

Again i need to develop for wdc1.1.1.Any idea how to quickly convert my wdc to wdc1.1.1

I am also facing the same issue with spaces in column names. The column names are dynamic and can contain spaces and special characters. I have written similar code to build the column metadata. Let me know, how you fixed the space issues.