How to save and share queries

You can save queries to re-run them later, schedule them, or share them.

πŸ’ͺ Did you know? You can only save queries through a collection. You can share collections with others, to share your queries.

Save a query

To save a query:

  1. Open the query in Insights.
  2. At the top right of the query, click the Save button.
  3. In the resulting Save query dialog, enter the following details:
    1. For Query name, enter a name for the query.
    2. (Optional) For Description, add a description for the query.
    3. For Collection, you can either:
      • If you have access to existing collections, click the Choose collection dropdown to select an existing collection.
      • If you do not have any existing collections, click the Create Collection button. In the Create collection dialog, enter the following details:
        1. For Name, enter a name for the collection.
        2. (Optional) To the left of the name, click the image icon to choose an icon for the collection.
        3. (Optional) For Description, describe the collection.
        4. (Optional) For Share, select other users or groups that can access the collection. (See below for more details.)
        5. At the bottom of the Create Collection dialog, click Create.
    4. (Optional) For Certificate, click the No certification dropdown to assign a certificate to the query.
    5. (Optional) For Linked terms, click the Select terms dropdown to assign a term to the query.
    6. At the bottom of the dialog:
      • To only save your query, click Save.
      • To save and share your query, click Save and share.
        1. In the Query saved dialog, enter the following details:
          1. For Add users or groups, select other users or groups that can access the saved query.
            1. (Optional) To the right of the user or group, click the Editor dropdown to change the sharing permissions:
              • Viewer allows users to view and run all queries in the collection, but not edit them.
              • Editor allows users to view, run, and edit all queries in the collection.
            2. Click Invite to invite the users or groups.
          2. (Optional) Click Copy Link to copy the link for the saved query to share with others in your team.
          3. (Optional) Click the Slack or Teams button to share directly on Slack or Microsoft Teams, respectively.
        2. Click Done to confirm your selections.
πŸ’ͺ Did you know? Atlan currently supports a query length of 2 million characters for saved queries.

Share a query collection

A collection helps you organize saved queries in Atlan. A collection could represent a topic, department, or team with similar saved queries under one roof. Within each collection, you can have a folder that contains multiple saves queries of a similar type. 

To share a collection of queries:

  1. Open Insights.
  2. In the upper left, click the papers-in-a-box icon.
  3. Under the icon, click the name of the selected query collection.
  4. From the resulting list of collections, hover over the collection you want to share.
  5. Click the 3-dot icon to the right of the collection name and choose Edit collection.
  6. In the Edit collection dialog, under Share:
    1. Search for users or groups with whom to share the collection.
    2. (Optional) To the right of the user or group, click the Can edit dropdown to change the sharing permissions:
      • Can edit allows users to view, run, and edit all queries in the collection.
      • Can view allows users to view and run all queries in the collection, but not edit them.
    3. Repeat these steps for each user or group with whom you want to share the collection.
  7. At the bottom of the Edit collection dialog, click Update.
πŸ’ͺ Did you know? Users with only Can view permissions will still be able to change the interactive part of interactive queries.

Move a saved query

To move a saved query to another query collection:

  1. Open Insights.
  2. In the upper left, click the papers-in-a-box icon.
  3. Under the icon, click the name of the selected query collection.
  4. From the resulting list of collections, hover over the collection from which you want to move a query.
  5. Click the 3-dot icon to the right of the saved query name, and then click Move to.
  6. In the Move to dialog, select the query collection to which you want to move your saved query.
  7. Click Move to complete moving the saved query.

To duplicate, rename, edit, or delete your saved query, click the 3-dot icon to the right of the saved query name and select the relevant option.

View query sidebar

Once you've saved a query, you can access the query sidebar to view additional context for your saved queries.

To open the query sidebar for a saved query:

  1. In the left Explorer panel in Insights, hover over a saved query and click the Open query sidebar icon.
  2. From the saved query sidebar in the right, you can:
    • View details about your saved query in Overview, including the actual query. (Optional) You can add more details to your saved query:
      • Click the star button to star the query for quick access.
      • For Description, add a description to your saved query.
      • Click +Add README to add a README to your saved query and provide more context.
      • For Collection, click the collection name to view the query collection.
      • Copy the SQL query or expand the query view to fullscreen.
      • For Terms, add a term to link to your saved query.
      • For Owners, update the owner of the saved query or add more owners.
      • For Tags, attach a tag to your saved query.
      • For Certificate, update the certification status of your saved query.
    • Click the Relations tab to view queried assets. 
      • (Optional) Select a related asset to open the asset sidebar. From the asset sidebar, click the Queries tab to view the saved query auto-linked to the asset.
    • Click the Activity tab to view the activity log for the saved query.
    • Click the Schedules tab to view associated schedules for the saved query, if any.
    • Click the Resources tab to view any linked resources.
    • Click the Requests tab to view any requests on the saved query.
    • Click the Properties tab to view query properties.
    • Click the Slack or Teams tab to view Slack or Teams messages pertaining to the query.

Link saved queries

Once you have saved a query, the saved query will be auto-linked to all the assets queried or referenced in the SQL query. Linked queries are displayed in the asset profile and sidebar.

You might want to link it to other assets, too. This can help you provide additional context on the assets and quickly find the saved query. For such assets, you can link the saved query as a resource.

To link a saved query to an asset:

  1. Open Insights.
  2. In the upper left, click the papers-in-a-box icon.
  3. Under the icon, click the name of a query collection.
  4. From the resulting list of collections, select a collection and then select the saved query you want to link as a resource.
  5. To copy the link for a saved query, you can either:
    • Click the 3-dot icon to the right of the saved query name and then click Copy link.
    • In the top right of the query editor, click the 3-dot icon and then click Share. From the Share menu, click Copy link.
  6. From the left of menu, click Assets to navigate to your assets.
  7. From the Assets page, select an asset to open the asset sidebar.
  8. From the asset sidebar on the right, click the Resources tab and then click + Add resource.
  9. In the Add Resource dialog, enter the following details:
    1. For Link, paste the saved query link you copied in Insights.
    2. For Title, add a title for your saved query.
    3. Click Add to add the saved query as a resource to the asset.
πŸ’ͺ Did you know? Any user in Atlan will be able to preview saved queries for auto-linked or manually linked assets from the asset sidebar β€” unless there are access policies prohibiting them. However, since guest users in Atlan do not have access to Insights, they will neither be able to view nor run any of the saved queries in Insights.

Related articles

Was this article helpful?
1 out of 1 found this helpful