In This Article:

    Query and Export

    In This Article:


      When to Use It

      Queries are a quick and flexible way to segment your supporter list using the trove of data that Salsa helps you collect about your supporters: location, activity history, group membership, and everything else.

      Queries can be used simply, just to get a quick head count for reporting purposes.

      But they're even more powerful when used to key mass targeting effects, such as:

      • Bulk updates to records
      • Targeting an email blast
      • Data export for mass-mailing

      How to Get There

      Just click the Query/Export navigation link in the Supporter tab to get started.

      Once you're there, Queries only have two simple steps:

      1. Build the query by setting parameters that define some segment of your list to select
      2. Optionally, take some additional action (such as exporting or bulk-updating) with the selected segment.

      Build a Query

      Building a query is simply describing the characteristics of supporters you'd like to identify. Any actions you take on this step of the query workflow are simply identifying supporters - you're not making any changes to supporter data until you get to the Take Action tab of the workflow (so don't worry!).


      Build a Single-Variable Query

      To create a simple query with one variable:

      • Click the Condition Type dropdown menu for a list of some overarching query categories available.
      • Any selection you make from the first drop down menu will open secondary menus with the specific conditions available for that Condition Type. Select a Condition from this updated secondary menu.
      • For a specific description of any of the various available conditions, click here.


      It is recommended that you select a segment of your list via the query tool when sending an email blast, but you can select your entire list by clicking (or by setting no query conditions) and hitting .

      Add Additional Variables to Your Query

      The query builder also helps you create complex queries embracing multiple variables ... such as supporters who both live in Arizona and have also donated.

      You can build your multi-variable query that connects those variables using AND (logical conjunction), or using OR (logical disjunction).

      • To add a second query term using AND (meaning the query will only select supporters of whom both terms are true), click the plus-button.png button on the right side of the query builder
      • To add a second query term using OR (meaning the query will select supporters of whom either term is true), click 'add an OR condition' towards the bottom of the query builder

      The Query tool can even mix and match AND and OR connectors in any combination you like, creating finely-attuned logic to identify the exact supporter segment you need.

      • Chain multiple colored boxes using the 'add an OR condition' button
      • Within those boxes, chain multiple AND conditions using the plus-button.png button
      • The query selects everyone who meets all the conditions of any one box


      Salsa uses the MySQL query syntax for queries, which means that you can use an underscore('_') to match any one character, and a percent sign ('%') to match all characters. But be sure to use the 'like' operator when building a query for wildcards -- otherwise, Salsa will try to match those exact characters! Wildcards can be used for almost all fields. For example, to find anyone with a street address, you would choose: Street like _%. To find anyone with an email address at one specific domain, you would choose:

      Saving a Query

      Need to use this query again and again, or just save it for future reference?

      Just enter a name -- any name will do -- in the Query Name text box at the top off the query builder, then click .

      Any query so named and saved will appear in the future in the Select a Saved Query pull-down menu. The next time you need it, just pick the saved query and Salsa will fill in the saved query conditions.


      Finding Deleted Supporters

      At the very bottom of the query builder, just above the Save and Run button, you'll see a checkbox option to "Query Deleted Supporters":


      Mass supporter deletions you accomplish through the query's bulk updater are actually only "soft" deletes. Such records can be recovered by ticking this box: when selecting the"Query Deleted Supporters" option, your query conditions will be applied not to your active supporter list but to the pool of soft-deleted supporters.

      To identify all of your deleted supporters, check this box and run a query with no query conditions selected.

      On the query Take Action tab (after clicking Save and run), the only option available is to Restore these supporters:


      Click this button, and you have now raised the dead. Your restored supporters will all retain their previous history and data.

      This feature applies only to supporters deleted from the date of release (September 2012) and on. Restored supporters will carry over their previous settings - i.e. a subscribed supporter will be restored as a subscribed supporter, an unsubscribed supporter will be restored as still unsubscribed. Additionally, a deleted supporter who takes action in your Salsa account - signs up again, donates, signs a petition, etc. - will not automatically be restored.

      Take Action


      Take Action is the second step of the query workflow. It's on this step that you can apply updates to the supporters who meet the conditions you set on step one. This is where you're changing your data so proceed carefully.

      Once you've built your query and hit , you'll advance to the query's Take Action tab: a menu of actions you can take with the queried segment.

      This tab looks pretty much the same regardless of what query conditions you've set in the first step.


      The overall count of supporters who match the conditions appears at the top of the next page. If you scroll down, the bottom of the page displays up to 200 clickable supporter records who fall among these query matches. They're handy for spot-checking.

      The remainder of the page consists of the various bulk operations you can take with your selected supporters. All bulk operations affect the entire selected segment -- not merely the 200-person spot-check sample.

      Group Operations

      Add to a group 
          You can add the supporters in your query set to a pre-existing group (you must create the group before you run the query).

      Delete from a group 
          Allows you to remove the supporters in your query from a group that they are in. This does not remove the supporters from your supporter list, nor does it remove the group itself.



      Tag supporters 
          This allows you to add a tag to all of the resulting supporters.

      Remove the following tag from these supporters 
          Allows you to bulk de-tag the selected supporters.


      Indicate that these supporters have signed a petition 
          Mark the queried supporters as signers of an existing Petition-style Action.

      Indicate that these supporters have participated in an action 
          Mark the queried supporters as participants in an existing Targeted-style Action.

      Indicate that these supporters have participated in an event 
          Set the queried supporters as attendee registrants for one of your Events.

      Supporter Operations

      Delete supporters 
          The button deletes your supporters from your list entirely. Bulk deletes are soft-deletions that are restorable via the Query; however, we always recommend exporting a local copy of the data to your own workstation before deleting.

      Bulk Field Update 
      This allows you to write a single value to any field for every queried supporter. You can choose one of two options:

      1. Update all instances of a field in the found set to a single value (e.g., all queried supporters' First Names become "Tom")
      2. Update all instances of one field in the found set to the value of another (e.g., all queried supporters' First Names become the value currently held in those records' Last Name field).


      Add to a chapter 
          Mark the queried supporters as members of one of your account's Chapters..

          Remove the queried supporters from one of your account's Chapters.


      Enables you to export the supporters in your query results of your query. Select an export data format (Tab delimited, Excel, or HTML) and, optionally, a subset of fields to include in the export. (Some large queries might lack these options. If they're not present, you'll only be able to export a tab delimited file consisting of all supporter fields.)

      Click once you've selected your export parameters to generate your data file.


      Although supplementary data like the actions supporters took or the donations they made, can be used as conditions to generate your query segment, the segment itself consists only of the core supporter data itself: the base supporter fields in Salsa, plus any custom fields you've created. To export a richer data set, such as supporters with their donations, you'll need to use a Report.

      Exports also allow for a Scheduled Export options. This can be handy if you need to automatically generate the report at a future date, or even on a recurring future schedule. To utilize this option, click and then click the blue link on the next screen to expand your scheduled export options.

      1. Set the "run and export this report" field to either "immediately" (to generate right away) or "on a schedule" (for scheduled exports into the future)
      2. Select a start time for the first report to run.
      3. Select the run frequency from the "Run the report" menu.
      4. Select one or more (comma-delimited) email addresses to receive the reports.

      The other fields on this page -- a custom header, optional include fields, compressed files -- are strictly optional.


      Flexibility & Limitations

      The flexibility that the Query builder provides, in allowing campaign managers to craft their own segments of supporters, can actually be its greatest limitation (from a technical perspective).  It will essentially try to build, on the back-end, whatever query it can, in order to process exactly what's being requested.  Sometimes this will end up with convoluted query logic which is not always optimized (and may not use database indexes effectively).  If you ever run into a Query that's timing out, or hitting a limit, then there is a work-around available.

      Was this article helpful?
      0 out of 0 found this helpful
      Have more questions? Submit a request


      • Hi Robert,

        Thanks for this info. So, does this mean we need to add the percentile at the time the contact is created? How would that work, practically speaking, since we don't input our own contacts - they get added automatically. Would we have to download the entire db, create a new field, and assign values to each entry?

        Comment actions Permalink
      • Hi Beth,

        Robert is going to respond to your inquiry directly in the support ticket instead of in the product documentation comments.  Look for his reply there.


        Comment actions Permalink
      • Is there a way to make a query "private" or lock it so that other users can't modify or change it? I've got some queries setup to add supporters to smart groups and I don't want someone else modifying the query and possibly messing up the smart group

        Comment actions Permalink

      Article is closed for comments.