1 of 1 people found this helpful
You could also use a Powershell script in order to do so. Create a configuration xml file like this to store the location of your csv file:
<server>Put the Tableau server name</server>
<!--This is the tableau server user name and password so we can login to the server>
<username>Put the Tableau user account username</username>
<password>Put the Tableau login password</password>
And then use the below Powershell script to read the csv file and configuration file and refresh the extract:
param ([string] $config_path = "C:\ExtractRefresh\config.xml")
[string] $cmddir = "C:\Program Files\Tableau\Tableau Server\9.0\extras\Command Line Utility")
$csvpath = $config_xml.selectsinglenode('/root/csvfile')."#text"
$csvfile = import-csv -path $csvpath
$server = $config_xml.selectsinglenode('/root/tableau/server')."#text"
$username = $config_xml.selectsinglenode('/root/tableau/username')."#text"
$password = $config_xml.selectsinglenode('/root/tableau/password')."#text"
foreach ($line in $csvfile)
if ($flag -eq 1)
#change directory to Tableau Command Line Utility
.\tabcmd login -s $server -u $username -p $password
#Refreshing the extract
$message=.\tabcmd refreshextracts --datasource $extractname --synchronous
if ($message -like '*DataSourceException*')
$status="Extract Refresh Failed"
$status="Extract Refreshed Successfully"
$message="Finished refresh of extract $extractname"
Please modify the script based on your needs.
Thanks a lot for providing the solution. I am going to try the solution after lunch and see if this works.
Even though I was not able to correctly able to edit your PS script (most likely because I am sure I did something wrong), following line in your script
if ($flag -eq 1)
..led me to great insight on how to do this in the batch solution I was working on, and after half an hour of Stackoverflow now I am successfully able to read and parse my csv and able to conditionally refresh my extract.
Thank you very much for your valuable time for making this great insight available to me.
That's great Ashish, Glad I was able to help a bit