support center

Search syntax: single queries

This a more detailed look at constructing single search queries in Close.io

To start creating basic search queries right away, head over to the search overview help article. After reading this, check out our article on combining queries.

Full text

Type a word in the search bar:

john

Close.io will find any leads that contain the word john somewhere in the lead (including its contacts, activities, opportunities and tasks). Queries are not case-sensitive, so john, John, and JOHN will all match.

Matches for lead and contact names are given higher priority. Leads named john or have contacts named john will be ranked higher in the search results than lead that have john in a call note.

This will also do a prefix search. Leads containing words that start with john will also be matched. Leads that have contacts named Johnson or Johnathan will also match the query.

You can also do a full text search with multiple keywords:

john doe

This will find any leads that contain both the word john and the word doe (or words that start with john and doe). The two words can appear in any order-- or be in two completely different fields.

If you only want to see leads with words in a given order, add in quotes to create a phrase match:

"john doe"

Now you'll still see leads matching john doe, but leads that have doe john will not show up. No prefix search is performed when using quotes, so a lead named johnson doe will not match this query.

Field search

While you can search all fields with a full text search, you can also limit your search to one field. Field searches have three parts: the field name, an operator (colon or equal sign), and a keyword.

city: Zurich
city=Zurich

The above two queries are equivalent; the spacing around the colon/equal sign is optional and doesn't change the meaning of the query.  Both searches will match leads that have the term Zurich in the city field.

If you are searching one field for multiple keywords, add in quotation marks/parentheses:

city:"New York"

name:( john doe )

The first query will do a phrase match for the city field. Leads with a city set to New York or New York City will match, but leads with York New or New Yorks will not.

Custom fields

Custom fields can be searched as well, just add custom. in front of the field name. Custom fields with spaces need surrounding quotes. For example:

custom.category: technology

"custom.Monthly Recurring Revenue": 1000

Note: The custom. prefix may be dropped for convenience if the name of the custom field doesn't clash with an existing field. However, we recommend to always use the custom. prefix when saving a smart view to prevent the it from breaking in the future.

User searches

updated_by: "Thomas Thumb"
updated_by: Thomas

User fields can be searched with a user's full name in quotes.

Note: If everyone has a unique first name, you can shorten the search to the first name alone. However, we recommend to always use full names when saving a smart view in case another user has the same first name in the future.

The special keyword me exists to match the current user:

created_by: me

Comparisons

We can search numeric fields with the operators > , < , >= , and <= .

activities >= 5

That query will list leads with at least 5 activities.

We can use the same techniques for monetary and percentage fields. (Just like spacing, the $ and % signs are optional.)

opportunity_value >= $100
opportunity_value>=100

opportunity_confidence>50%
opportunity_confidence > 50

Date searches

Date fields can be filtered just like numeric fields. Many common date formats work:

last_communication: 2016-04-01
last_communication: 4/1/16
last_communication: "April 1st"

All three queries above match leads with a last communication date of April 1st, 2016. When a year isn't specified, the current year is used.

Date comparisons

last_communication > "4/1/16 6:45pm"
last_communication > "2016-04-01 18:45"

Both searches will pull in leads whose latest communication took place later than April 1st, 2016 at 6:45 pm.

Relative dates

Relative dates are especially helpful in smart views. The terms today, yesterday, now, and tomorrow can be used. They can be combined with comparisons as well ( > , < , >= , <= ):

created: today

updated: yesterday

task_due < now

opportunity_close: tomorrow

Week, month, and quarter can also be used. Note: weeks start on Sunday. If it's currently Wednesday, the search latest_call_created: "this week" will show all leads that had their latest call sometime between last Sunday and today.

latest_call_created: "this week"

opportunity_created:"this month" 

last_lead_status_change_date: "last quarter"

You can also use a  "x days ago" or "x weeks ago" format. The following searches match leads that were updated 30 days ago or less, and leads that were created more than 5 weeks ago:

date_updated <= "30 days ago"

created > "5 weeks ago"

Similarly, we can compare dates in the future using "x days/weeks from now":

opportunity_close < "2 weeks from now"

Here are some more examples showing different formatting options:

date_updated < "30d ago"
date_updated < "5 minutes ago"
date_updated < "2 days and 10 hours ago"
date_updated < "1 week ago"

Time zone searches

You can search for leads that are in a specific time zone (e.g. leads located on the East Coast):

timezone:ET

A few notes about time zones:

  • A lead can be associated with multiple time zones if it has multiple addresses or phone numbers with different area codes.
  • If you know that either phone numbers or addresses will be a better timezone predictor, add phone_ or address_ to your timezone keyword (e.g. phone_timezone , address_timezone).
  • When you search for a particular local time, we find leads where any of their time zones match the local time you requested.
  • Keep in mind that the "Local time" column is not capable of showing multiple local times. If multiple time zones are associated with a lead, one local time is displayed at random.

Ready for more time(zone) traveling? Check out our combined query article for details on how to use the local_time keyword.

Sorting

When all leads are displayed, by default they are sorted by date last updated. However, there are other ways you can sort your leads. You can sort leads by typing directly into the search bar or by using the sort dropdown at the top right of the lead results table.

sort:display_name

This order leads alphabetically by their display name. (The display name is the lead name, or the primary contact name if there is no lead name.)

sort:-display_name

Adding a minus sign to the field name will reverse the order.

Leads can be sorted by any numeric or date field and by some text fields (lead_name, display_name, contact_name). This applies to custom fields that are numeric or contain a date. Text and choice custom fields cannot be used for sorting.

Now you're ready to start combining search queries.