Importing and Exporting Reusable Query Snippets
QuerySurge provides users the ability to import and export one or more Reusable Query Snippets using an appropriately-formatted Excel spreadsheet. This allows you to export a set of Reusable Query Snippets, perform bulk modifications on them, and import them back into that same instance of QuerySurge. Additionally, you can use this feature to transfer Reusable Query Snippets between different instances of QuerySurge.
Note: The QuerySurge Import/Export feature is licensed separately.
Full v. Relative Paths
Unlike with QueryPairs and Staging Queries, QuerySurge only supports full (absolute) paths when importing and exporting Reusable Query Snippets. All Snippets exported through QuerySurge will contain their full path beginning with the 'Reusable Query Snippets' folder. Additionally, when importing a Snippet to a QuerySurge instance that does not contain a Snippet with the same name, a full path is required in order to create a new Snippet.
Supported Excel Versions
QuerySurge currently supports Reusable Query Snippet imports and exports for Excel 2007 and later. When importing, QuerySurge supports both .xls and .xlsx file extensions. When exporting, all files will be generated with a .xlsx file extension.
Reusable Query Snippets Sheet
Your Excel workbook must contain a single sheet named Reusable Query Snippet Exports. This sheet contains the data pertaining to your Reusable Query Snippets.
Format and Layout
When importing Reusable Query Snippets, you must use our format and column names. When modifying your Reusable Query Snippets from an exported Excel sheet, this is simple. However, if you create your own Excel document from scratch, please be sure to adhere to our layout.
The Reusable Query Snippet Exports sheet contains the following column names:
| Column Name | Content |
|---|---|
| Snippet ID | The ID of the Snippet. |
| Snippet Name | The name of the Snippet. If QuerySurge finds an existing Snippet with this name, it will be updated, otherwise a new Snippet will be created. |
| Path |
The Snippet's path.
|
| Snippet | The underlying data stored in the Snippet. |
| Notes | The Description attached to this Snippet, which is stored in the Properties tab. |
| Asset Tags | A semicolon-separated list of Asset Tags associated with the Snippet. |
Requirements
There are a few requirements you must take into consideration when importing Excel files into QuerySurge. The Snippet Name field is always required regardless of whether an existing Snippet is being updated or a new one is being created. Additionally, if a new Snippet needs to be created, then a Path is required and must end with the specified Snippet Name.
Restrictions
QuerySurge does not support the use of formulas in imported Excel files. And, of course, you must use QuerySurge's Excel format.
How do I Access this Feature?
You can import/export Reusable Query Snippets from the Design Library by right-clicking a folder or Reusable Query Snippet (either in the Design Library Tree or the Library Explorer).
Exporting to an Excel File
When exporting, each Snippet's text will be checked for references to other Snippets. Any referenced Snippets that were not already included in the export will be appended to the Excel file in order to mitigate potential issues during import.
What is the Pre-Scan?
You are encouraged to Pre-Scan your Excel file before importing it. The Pre-Scan affords QuerySurge the opportunity to preview your file and highlight possible pitfalls and erroneous input. After pre-scanning, you will receive an output window with informational messages in black, warning messages in yellow, and error messages in red. You will need to fix the errors before importing.
If you attempt to import a spreadsheet that contains errors, QuerySurge will display those errors to you and no Reusable Query Snippets will be imported.
Importing to a QuerySurge Instance
Importing Reusable Query Snippets will be handled the same way regardless of whether you are importing to a new QuerySurge instance or the same instance that they were originally export from. QuerySurge only uses the Snippet Name to check for existing Snippets.
If an existing Snippet was found, its Snippet Text, Notes, and Asset Tags will be updated with the values from the spreadsheet.
If no existing Snippet was found, a new Snippet will be created at the Path provided in the spreadsheet with the specified Snippet Text, Notes, and Asset Tags.
Similarly to exporting, the Snippet Text of all Snippets being imported is checked for references to other Snippets. If any references are found that a) don't already exist in QuerySurge and b) weren't included in the spreadsheet, empty Snippets will be created with the referenced Snippet Names in the root Reusable Query Snippets folder.
Note: When you import from the Design Library Tree, your Reusable Query Snippets will be imported under the tree node that you select for import unless you have Full paths in your Excel file. Remember, a Full path is any path the start with Staging Queries (no leading forward-slash).
Minimum Requirements
The minimum requirements to create a Reusable Query Snippet using the import feature are a Reusable Query Snippet Name and a Path. All other values will either be blank or set to a predefined default value. However, QuerySurge cannot proceed without a name and path.
Sample Import File for Uploading New Reusable Query Snippets
You can download a sample upload file from the Resources section below. The purpose of this file is to show how to import new Reusable Query Snippets from an Excel sheet. The sample file contains some sample Reusable Query Snippet data.
Resources