Export a Filtered Table with Spotfire Automation Services

This week, a user asked me to export a filtered table from Spotfire and email it to him. I thought this would be quick with Spotfire Automation Services, but it rapidly turned into either “not possible” or “never gonna figure this out”. So, I reached out to TIBCO support for some assistance, and they were able to show me something new that I’d never seen in Automation Services. Read on to learn more.

Spotfire Automation Services

For those who aren’t familiar with Spotfire Automation Services, it’s a handy little add on that you can purchase for reasonable amounts of $$$. My two most common use cases are ….

  1. Emailing reports, data, and content to users
  2. Triggering caching of information links for faster project loading

I’m sure the second use case perked up a few ears, and I’ll be writing about that soon. In the meantime, this is what the list of available options looks like. All AS jobs begin with the Open Analysis from Library task.

My Use Case

My user wanted me to export a filtered table and then email it to him. In the screenshot above, you can see the Export Data to File and Send Email tasks. I’ve pasted the Export Data to File task below. Do you see any place where filters could be applied? No. If my user wanted a report or a PDF, I would know exactly where to go to filter. But, how do I achieve that task from this dialog? Keep reading.

Spotfire Automation Services Solution

Even though I was certain it wouldn’t work (and it didn’t), I tried saving the DXP with filtering on and exporting the data table (second option above, not the one that is selected). So I reached out to TIBCO support who showed me this.

I hadn’t considered putting anything in the configuration block, and my brain exploded a little bit upon seeing this.

cole sprouse GIF
mind blown

So what is the configuration block you ask?

…use this advanced feature to provide a configuration block to specify the initial state of the analysis. A configuration block is a piece of code that defines, for example, which page is active in the analysis when the analysis is opened, or applies a specific bookmark when the analysis.

https://docs.tibco.com/pub/spotfire_server/10.3.13/doc/html/TIB_sfire_autsvcs_UserGuide/autoservices/topics/open_analysis_from_library.html

Now, this is only part of the solution. My initial attempts still failed, and I had more digging to do. But, before I get to that, let me provide some additional information before you start keying in syntax.

Information

In my first attempt, I used single quotes instead of double quotes because they are usually interchangeable, but in this case, they are not. You must use double-quotes.

Information

You must include the semi-colon at the end. Without it, Spotfire errors.

The Final Solution

I implemented the configuration block shown above and the Export Data to File settings shown here. My project opened with 1,650 of 173,453 records, as expected. However, when exported, the table still contained all records.

The trick to getting a filtered data set in the export is to export a table visualization rather than the table. It may seem like I’m talking in circles, but to Spotfire, a table and a table visualization are two different things. Here’s the config that works.

Now you know how to filter a table in Spotfire Automation Services. I’d like to give a big thank you to Shrutika with Spotfire support for their assistance on this case. Stay tuned for more content on how to use Automation Services to speed up DXP loading.

Other Sweet Spotfire Content

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.