Callum, I'm not following what you're trying to do.
If you publish an extract data source to Server, and there is a workbook (twb) that points at that data source, it will get the new data without you needing to republish the workbook. You will have to hit the "Refresh" button in the workbook (whether it's a local twb file that uses a server-based data source OR a published workbook that resides on the same server as the data source).
Why do you think you need to publish a TWBX to Server?
Hey Michael, thanks for the reply, and you're correct, the Tableau server part of this thread is a red herring.
What I want to do is much simpler. I have a TDE file and a TWB file, now I want to combine them to create a TWBX file (that I can distribute to others). I can't find an appropriate API call to do this (but I am almost certain one must exist). For now, I am going to write some code to take the two files, Zip them into a file with the structure:
Then rename the zip file extension to TWBX
I am sure this will work, but just thought there must be a more elegant way to do it via an API.
I'm not entirely sure that WILL work, but it's worth trying!
Are the folks you intend to send this to as a TWBX file only using Reader? That is, they don't have access to Server?
Before you go a whole lot further, please look at this thread, particularly the license restrictions on what you're trying to do.
Michael, thanks for the comments.
I have a working solution in python, that does what I describe, just thought there must be an easier way to do it, but now understand that Tableau don't want you doing this... It seems you're right, as in, it's not allowed from a licensing point of view, so I guess I will never be able to use this code. I will post it here in the hopes that no one else uses it either.
def create_twbx_from_tde_and_twb(tableau_twbx_file, tableau_tde_file, tableau_twb_template_file, tableau_image_file): #start afresh each run (remove the directory if it exists) temp_dir = "/tmp" if os.path.exists(temp_dir+'/Data'): rmtree(temp_dir+'/Data') if os.path.exists(temp_dir+'/Image'): rmtree(temp_dir+'/Image') #set/make/copy the files to the directories "Data" and "Image" tde_location = '/Data' twb_image_location = '/Image' os.mkdir(temp_dir+tde_location) os.mkdir(temp_dir+twb_image_location) copyfile(tableau_twb_template_file,temp_dir+'/'+tableau_twb_template_file) copyfile(tableau_tde_file,temp_dir+tde_location+'/'+tableau_tde_file) copyfile(tableau_image_file,temp_dir+twb_image_location+'/'+tableau_image_file) #zip the 3 files to create the TWBX file (TWB, TDE and a logo image file) z = zipfile.ZipFile(temp_dir+"/"+tableau_twbx_file, "w") z.write(temp_dir+"/"+tableau_twb_template_file,arcname="/"+tableau_twb_template_file) z.write(temp_dir+"/"+tde_location+'/'+tableau_tde_file, arcname=tde_location+'/'+tableau_tde_file) z.write(temp_dir+"/"+twb_image_location+'/'+tableau_image_file, arcname= twb_image_location+'/'+tableau_image_file) z.close()