Page tree
Skip to end of metadata
Go to start of metadata

Creating Saved Searches

Saved searches have more configuration options than the Main Search Block, and saved searches can be pinned to the left pane, easily accessed from the table view, and used in embedded tables and hyperlink URLs. You can use saved searches to create sophisticated, reusable searches; to apply complex filters, even without saving the search; and even just to save the sorting scheme you want to use for the records.

Create a Saved Search

To create a new saved search:

  1. Go to the table you want to search.
  2. Hover over the Search drop-down and click New. The Saved Search wizard appears.

General Tab

On the General tab, you set up the conditions of your search. This is the most important part of the wizard, and it can be the most complex depending on the search you build.  Agiloft supports several types of filters, which can be combined to create complex expressions. Each filter you add is placed on its own row, representing a separate search condition. You can add one filter or combine many to create a complex search with many conditions.

Example

Here's a complex example. Going through the rows in order, this search finds records: (1) with priority marked High or above that were (2) last edited more than eight hours ago, according to Company team working hours, and (3) changed status to Reopened; or records (4) whose status is not yet Closed that also (5) have Critical priority and (6) were last edited more than one hour ago, according to Company team working hours.

Each filter type works differently, but regardless of which filter you add, each row includes:

  • Up and down arrows: Hover over the area to the left of the row until the gray arrows appear. Click the arrows to move the row up or down in the list. The list order determines the order of execution followed by the system, so it can be important to place conditions in a specific order. The arrows don't appear if you have only one row. 
  • Parentheses drop-down menus: Select parentheses to group criteria together. In the example above, the first three rows are grouped with and, and the last three rows are grouped separately with and, so records must meet all of the first three criteria or all of the last three criteria to be included in the search results. Parentheses are located on the left and right end of each row.
  • Garbage can icon: Click the garbage can icon to eliminate the associated row. Above the first icon, you can also click Clear Filters to remove all rows and start over.

Fields, Values, Variables, and Operators

Most of the filters evaluate fields and their values, table and global variables, and different types of operators.

  • Fields: Listed in a drop-down menu. These are limited by the access permissions of the user creating the saved search.
  • Values: Choice and multi-choice fields offer a drop-down menu. For other data types, you can enter a value manually in the text box.
  • Variables: If you select Variable from the Value drop-down menu, you can click the search icon to open a variable selection window. Variables have a $ prefix and contain no spaces; variables for user values or fields in other tables have a $global. prefix and are located on the Global Variables tab. For example, you might search for records that are assigned to the $creator_name user, or to $global.my_escalation_team.
  • Operators: See the table below for details on different operators.


OperatorFunctionExample

equals, =

Finds all records where the values are an exact match. With this operator, variables are useful to avoid typos and make searches flexible in case names, dates, or other values are updated.Priority equals High

does not equal, !=

Finds records with any value other than the value specified.Status does not equal Cancelled
is greater than, >

Finds records with a value that is numerically greater than the value specified.

For choice lists, this finds records with any value higher on the list than the specified value. For example, a search for records where Priority is greater than or equal to Medium returns different results based on the order of values in the choice list.

Choice ListPriorities Searched

Very High

High

Medium

Low

Very High

High

Medium

Low

Low

Medium

High

Very High

Low

Medium

High

Very High

Contract Amount is greater than 100000
is less than, <Finds records with a value that is numerically less than the value specified. For choice lists, this finds records with any value lower on the list than the specified value.Contract Amount is less than 1000000

contains

Finds records where the field includes at least one of the specified values.Assigned Teams contains $global.my_team

does not contain, !~=

Finds records where the field does not include any of the specified values.Status does not contain Completed, Abandoned

is contained in, <<

Finds records where all the field selections are included in the specified values, even if additional values are specified. For example, a search for Setup is contained in Computer, Phone, Access Card, Desk, Chair, Headset would return records with some or all of these setup items selected, as long as at least one is selected.Setup is contained in Computer, Phone, Access Card, Desk, Chair, Headset

is not contained in, !<<

Finds records where none of the field selections are included in the specified values. For example, a search for Asset Type is not contained in Laptop, Desktop, Tablet would return only records of other types.Asset Type is not contained in Laptop, Desktop, Tablet
is fully contained inFinds records where the field selections exactly match the specified values. For example, a search for Assigned Teams is fully contained in HR, Finance, Accounting would return only records that are assigned to all three teams.Assigned Teams is fully contained in HR, Finance, Accounting
is not fully contained in

Finds records where the field selections don't match or only partially match the specified values. For example, a search for Assigned Teams is not fully contained in HR, Finance, Accounting would return records assigned to some or none of those three teams, but not records assigned to all three.

Assigned Teams is not fully contained in HR, Finance, Accounting
overlaps with items inFinds records where at least one of the field selections matches at least one of the specified values. For example, a search for Company Roles overlaps with items in Supervisor, Manager, Shift Manager would return records with at least one of these roles selected.Company Roles overlaps with items in Supervisor, Manager, Shift Manager
does not overlap with items inFinds records where none of the field selections match the specified values. For example, a search for Company Roles does not overlap with items in Supervisor, Manager, Shift Manager would return records where none of these roles are selected.Company Roles does not overlap with items in Supervisor, Manager, Shift Manager

Filters

Each filter works differently and applies best to different use cases. This section describes each filter type in depth.

Simple

Simple filters include a field in the record, listed alphabetically in the first drop-down menu; an operator in the second drop-down menu; and a value or variable. Simple filters are used in a variety of ways:

  • To find records with a particular field value
  • To find records with an empty field using a variable of $null
  • To match a field value to the value of another field, using a variable
  • To match a field value to a user record value, using a global variable

To create a Simple filter:

  1. Click Simple to add a new Simple filter row at the bottom of the list.
  2. If necessary, use the arrows on the left side of the row to move it up to a new position in the order of execution.
  3. Choose and or or from the Boolean drop-down to determine whether the filter is an additional requirement or another way to fulfill the search requirements. For example, to find records that match every condition, select and in front of every row. Make sure your selection interacts with parentheses as expected.
  4. If necessary, use the drop-down menu to open parentheses at the appropriate level. Parentheses allow you to layer Boolean properties to create sophisticated search conditions. In the example at the beginning of this section, parentheses are used to create two groups of conditions, to allow two ways for records to be found by the search.
  5. Choose the field you want to search on from the drop-down menu. If you leave this set to -TEXT- instead of a specific field, the system searches all of the text in the records including fields and attached searchable files, such as .doc, .docx, and .txt. Text-based PDFs, such as converted documents or OCR-scanned files, are also searchable, but files scanned as images are not.
  6. Choose an operator from the list. The operators available in the drop-down depend on the field you select to search on. For example, selecting a date field, such as Date Created, changes the operator drop-down to a popup calendar date picker.
  7. If applicable to the field's data type, select Value or Variable from the drop-down. Value requires a specific value or text entry to match, while Variable allows you to check the values of other fields, users, or system properties.
  8. Enter or select the value or variable you want to compare to.
  9. By default, the Now checkbox is selected, and the system searches only current values of fields. You can search for records that ever met the condition by clearing this checkbox. However, searching record histories in this way can take significantly more time and resources.
  10. If necessary, use the drop-down menu to close parentheses at the appropriate level.

Time

Time filters measure the time from a Date or Date/Time field value forward or backward by days, hours, or minutes. They are most commonly used for time-based rule notifications and reports. For example, this search might run once a month: “Find all records whose Contract End Date is between 3 and 4 months in the future.” It is common to combine two relative time criteria in this way. If today is January 1, the search finds records with a Contract End Date between April 1 and April 30.

Time filters search on an amount of time relative to a specific point in time, such as 30 days from today. Calendar filters, on the other hand, search specific calendar periods relative to today, such as last month. Because of the way the system stores time, searches on a range of times are handled better with a Calendar filter.

To create a Time filter:

  1. Click Time to add a new Time filter row at the bottom of the list.
  2. If necessary, use the arrows on the left side of the row to move it up to a new position in the order of execution.
  3. Choose and or or from the Boolean drop-down to determine whether the filter is an additional requirement or another way to fulfill the search requirements. For example, to find records that match every condition, select and in front of every row. Make sure your selection interacts with parentheses as expected.
  4. If necessary, use the drop-down menu to open parentheses at the appropriate level. Parentheses allow you to layer Boolean properties to create sophisticated search conditions. In the example at the beginning of this section, parentheses are used to create two groups of conditions, to allow two ways for records to be found by the search.
  5. Choose the field you want to search on from the drop-down menu. Only date- and time-related fields appear in the list, since other data types aren't compatible with Time filters.
  6. Choose an operator from the list. For these data types, you can choose between equal to, greater than or equals, greater than, less than or equals, and less than.

    Because Date fields store a hidden time value of midnight, choose the operator carefully when searching on a Date field. For example, a Date will equal a Date/Time field only at midnight, and a measurement of 24 hours is calculated from midnight on the specified Date.

  7. Enter a value and select the unit from the drop-down menu. For example, you might enter 15 and choose Minutes from the drop-down.

  8. Choose which direction you want to search: choose old to find records whose date is in the past, or choose in the future to find records with dates in the future. For example, "less than one week in the future" finds records with dates up to one week later than today. A search for "less than one week old" finds records with dates within the past week.
  9. If necessary, select the Limit to checkbox to filter out working or non-working hours for a team. For example, a search looking for overdue records might need to measure time only during working hours. If you do use this feature, make sure your units are set to Hours, not Days. Days are defined as 24 hours, so if you use an eight-hour workday, it would take three workdays to count as one measured Day. To add the working hours filter, select the checkbox and then:
    1. Choose Working or Non-Working from the drop-down.
    2. Select a specific team from the list, or choose a field to check for the team.
  10. If necessary, use the drop-down menu to close parentheses at the appropriate level.

Calendar

Calendar filters report on activity during a calendar period, measured by year, quarter, month, week, day, hour, or minute. These filters search calendar periods, such as last month, as opposed to the more exact measurements Time filters use, such as 30 days.

For example, a search run on March 15 using a Time filter for less than 30 days old will return dates from February 13 to March 15, but a Calendar filter for last month will return dates from February 1 to February 28. For another example, a Calendar filter searching for Date Created is equal to this year will return all records with a Date Created that falls within this calendar years.

Calendar weeks run Sunday through Saturday.

To create a Calendar filter:

  1. Click Calendar to add a new Calendar filter row at the bottom of the list.
  2. If necessary, use the arrows on the left side of the row to move it up to a new position in the order of execution.
  3. Choose and or or from the Boolean drop-down to determine whether the filter is an additional requirement or another way to fulfill the search requirements. For example, to find records that match every condition, select and in front of every row. Make sure your selection interacts with parentheses as expected.
  4. If necessary, use the drop-down menu to open parentheses at the appropriate level. Parentheses allow you to layer Boolean properties to create sophisticated search conditions. In the example at the beginning of this section, parentheses are used to create two groups of conditions, to allow two ways for records to be found by the search.
  5. Choose the field you want to search on from the drop-down menu. Only date- and time-related fields appear in the list, since other data types aren't compatible with Calendar filters.

    Because of the way the system stores time, searches on Elapsed Time fields are best handled through a Time filter.

  6. Choose an operator from the list. For these data types, you can choose between equal to, greater than or equals, greater than, less than or equals, and less than.

  7. Choose a range and direction from the drop-down list. For example, "this" to refer to the current period, or "past 2" to search the previous two months.
  8. Choose the calendar period you want to use, such as month or year.
  9. Select KB time or User time to determine the time zone used in the search.
  10. By default, the Now checkbox is selected, and the system searches only current values of fields. You can search for records that ever met the condition by clearing this checkbox. However, searching record histories in this way can take significantly more time and resources.
  11. If necessary, use the drop-down menu to close parentheses at the appropriate level.

Advanced

Advanced filters are critical to automation. They are used to find records in which a specific field did or did not change at a certain point in time to or from a specific value. For example, you might search for records in which the Priority field was changed during the last user's modification, from any value to either Critical or High. 

To create an Advanced filter:

  1. Click Advanced to add a new Advanced filter row at the bottom of the list.
  2. If necessary, use the arrows on the left side of the row to move it up to a new position in the order of execution.
  3. Choose and or or from the Boolean drop-down to determine whether the filter is an additional requirement or another way to fulfill the search requirements. For example, to find records that match every condition, select and in front of every row. Make sure your selection interacts with parentheses as expected.
  4. If necessary, use the drop-down menu to open parentheses at the appropriate level. Parentheses allow you to layer Boolean properties to create sophisticated search conditions. In the example at the beginning of this section, parentheses are used to create two groups of conditions, to allow two ways for records to be found by the search.
  5. Choose the field you want to search on from the drop-down menu. Advanced filters can only be used with fields that are tracked by history.
  6. Next to In this period, choose the point in time you want to evaluate:
    • Last User's Modification: Finds only the last change made by a user. 
    • Last Modification: Finds the last change, whether made by a user or a rule.
    • Earliest: Finds changes that have occurred since the date of the earliest record found.
    • Last: Finds changes in the time period specified in the last two fields, such as the last 2 minutes, 4 days, or 10 years. 

  7. If you selected Last, enter an integer and select a unit of time. For example, 2 weeks.
  8. Choose whether to search values that did or didn't change:

    1. Did Not Change: Finds records that did not change. This option is disabled if you selected Earliest.

    2. Changed From: Finds records that have changed.

  9. If you chose to search records that did change, choose the previous and new values you want to find. You can choose any value or specific values, for either side of the change. Each possible value for the field is listed with a checkbox; if you select all the checkboxes, it works the same as searching for any value.

  10. If necessary, use the drop-down menu to close parentheses at the appropriate level.

Related Table

Related Table filters are used to run searches on related tables and linked fields. This filter is not used frequently, but it is important in certain situations because you cannot search within records in a related table using the normal search filters. Related Table filters only run on existing saved searches in the target table, which means you often need to create a saved search in a different table before you can create the saved search for the table that holds the related table. Because there is no option to create a saved search for a different table within the active table, so if you need to create one, you have to go to the other table, create the search, and then return.

Example

For example, if you have an Asset table and a Contract table and the Asset table has linked fields pointing to the Contract table, you might create a search in the Contract table named "Contracts renewed in the Last 3 Months." Then, in the Asset table, you can create a saved search and apply a Related Table filter to the linked fields in the Contract table using the "Contracts renewed in the last 3 Months" saved search.

While the same search can be accomplished using one or many simple filters, for large tables a Related Table filter is more efficient.

To create a Related Table filter:

  1. Click Related Table to add a new Related Table filter row at the bottom of the list.
  2. If necessary, use the arrows on the left side of the row to move it up to a new position in the order of execution.
  3. Choose and or or from the Boolean drop-down to determine whether the filter is an additional requirement or another way to fulfill the search requirements. For example, to find records that match every condition, select and in front of every row. Make sure your selection interacts with parentheses as expected.
  4. If necessary, use the drop-down menu to open parentheses at the appropriate level. Parentheses allow you to layer Boolean properties to create sophisticated search conditions. In the example at the beginning of this section, parentheses are used to create two groups of conditions, to allow two ways for records to be found by the search.
  5. Choose the related table or linked field you want to search on from the drop-down menu.
  6. Choose an operator from the list, such as contains or does not contain.
  7. Choose a saved search from the drop-down menu. If none of the available searches suits your needs, you need to navigate to the source table, create the saved search there, and backtrack to this saved search.
  8. If necessary, use the drop-down menu to close parentheses at the appropriate level.

Run-Time

Run-Time filters allow the user to enter a search value whenever they run the search. This makes the search more flexible, so you can avoid creating multiple searches that are almost identical. They are extremely useful for reports and ad hoc searching.

Example

If you want to search for all active support cases related to one company, you can accomplish this with a Simple filter. If you want to search for all active support cases related to each company using simple filters, you would need a different saved search for each company. Instead, you can use a Run-Time filter and accomplish this with only one saved search. When the search is run, a pop-up appears to allow the user to enter a company name, or clear the checkbox to search for any value. This also works when the saved search is applied to charts and reports.

You can also define other search criteria, such as the Status criterion shown here, to narrow the search results without requiring the user to select multiple criteria.

To create a Run-Time filter:

  1. Click Run-Time to add a new Run-Time filter row at the bottom of the list.
  2. If necessary, use the arrows on the left side of the row to move it up to a new position in the order of execution.
  3. Choose and or or from the Boolean drop-down to determine whether the filter is an additional requirement or another way to fulfill the search requirements. For example, to find records that match every condition, select and in front of every row. Make sure your selection interacts with parentheses as expected.
  4. If necessary, use the drop-down menu to open parentheses at the appropriate level. Parentheses allow you to layer Boolean properties to create sophisticated search conditions. In the example at the beginning of this section, parentheses are used to create two groups of conditions, to allow two ways for records to be found by the search.
  5. Choose the field you want the user to search on from the drop-down menu.
  6. Choose an operator from the list. If you chose a choice field or linked field, you can select the "is contained in" or "is not contained in" operator to allow the user to select multiple values from the field at run-time.

    Example

    A run-time search that searches "is not contained in" for Status, with the values "Open" and "In Progress" selected, would return records with any status other than "Open" and "In Progress."

  7. By default, the Now checkbox is selected, and the system searches only current values of fields. You can search for records that ever met the condition by clearing this checkbox. However, searching record histories in this way can take significantly more time and resources.

  8. If necessary, use the drop-down menu to close parentheses at the appropriate level.

Duplicate

Duplicate filters help find duplicate records so they can be eliminated. They allow you to exclude a certain number of records from the results. Although you can use a Duplicate filter in conjunction with other filters, it is always positioned at the bottom of the order of execution, and it can't be included in parentheses. You can't use a Duplicate filter with a First/Last filter.

For example, if a field needs to be made unique after it has duplicate values, a Duplicate filter can be used to find the duplicates so that they may be deleted. In the example below, the search finds any records that have a duplicate value in the Additional Information field, and it excludes the first record found.

To create a Duplicate filter:

  1. Click Duplicate to add a Duplicate filter row at the bottom of the list.
  2. Choose the field you want to match on using the search icon.
  3. Choose how many matches are required before the record is returned as a duplicate. You must enter an integer, 2 or higher.
  4. If necessary, enter how many records to exclude, starting with the first result. For example, you might enter 1 so that the first record is excluded from the results, and you can delete the results while retaining one of the duplicate records.
  5. Select or clear the Exclude NULLs checkbox to determine whether empty fields are considered. If you clear the checkbox and many records have no value in the selected field, you might have a lot of search results.

There is currently no way to merge records when duplicates are found. Cleaning up duplicates is a manual process.

First/Last

The First/Last filter is very similar to the Duplicate filter, but it allows you to limit the results found based on a sort order defined on the Sorting tab. You can't use a First/Last filter with a Duplicate filter.

For example, the First/Last filter allows you to:

  • Find the last three products purchased by this customer
  • Find the last five cases submitted from this location
  • Find only the unique people who have submitted noise complaints last month, by matching on fields such as Full Name and Case Type but reporting only one match

To create a First/Last filter:

  1. Click First/Last to add a First/Last filter row at the bottom of the list.
  2. Choose the field you want to match on using the search icon.
  3. Choose how many matches to report.

Sorting Tab

On the Sorting Tab, define how the search results are sorted with up to five criteria. Sorting is especially important for searches that use Duplicate or First/Last filters, which return records based on the result order. The default sorting is by descending ID.

  1. If desired, select the Sorting by best match checkbox. This prioritizes records that match the search criteria most closely, after which sorting is decided by the selected criteria below.
  2. For as many levels as you want to use, starting with the First Sort row:
    1. Choose a field from the drop-down menu. Results are sorted on this field's value.
    2. Choose whether to sort in ascending or descending order. Different data types apply these values differently. For example, numerical data types ascend from low numbers to high numbers, while choice fields ascend according to the order of the values in the list.

Options Tab

The Options tab defines several important behaviors for the saved search, and perhaps most importantly the name of the saved search. Naming conventions are important when creating a complex system. When someone looks at the name of a saved search or the name of a rule or action, they should have a pretty clear idea of what it does.

Renaming saved searches can be difficult. You cannot rename a saved search from within a rule or certain other places; you must create an entirely new search. If you do need to rename a search, do so from the Search > Manage... drop-down on the main search block. This method updates the search name within rules that use it.

On the Options tab:

  1. Choose whether to save the search. If you select Yes, give it a name and brief description, and select whether to save it as a new search or overwrite an existing search by the same name. If applicable, add a prefix to indicate where the search is being used, so others can tell what areas of the system will be affected if they make changes:
    • R: used by a rule

    • P: used as a group permissions filter

    • C: used in a chart or report

    • CF: used as the filter on a calculation field
    • LF: used as the filter for a linked field
    • MT: refers to "multi-table," used to compare the value in a linked table to a value in the current table; it's critical to name these searches really clearly because they always appear out of context

  2. If necessary, select tables in the Table Tree where the search can be used. Hold Ctrl to select multiple tables. If you create a saved search from a specific table, your search might automatically be restricted to the current table only.
  3. Choose whether to search subtables.
  4. Choose whether to search for synonyms. Note that this option is more resource-intensive.
  5. Choose whether to show context in the search results, which offers the text surrounding the value relevant to the search result.
  6. Choose whether to keep the current view when showing search results or to apply a specified view every time the search is run.
  7. If necessary, add summary information to the search result by choosing an operator and field. For example, you might automatically show the total value of all the contracts returned by the search. Any calculations appear above the list of results, in the Status area, when running the search. If more than one calculation is shown, each is displayed on its own line.

Apply Tab

On the Apply tab, define which groups can access the search and which groups can see the search on the Search drop-down menu, in the left pane, and on the My Assigned list. The Apply tab might not appear if you don't have the necessary permissions.

  1. Select who to make the search accessible to. These users can access the search from the Manage option in the Search drop-down, even if this search doesn't appear directly in the Search drop-down.

    Searches should be made available to the admin group whenever they are used for a rule, group permission filter, chart or report, calculation field filter, linked field filter, or multi-table comparison. These searches are typically made active for the admin group as well. If a search is not made available to users in a certain group, it does not show up under the Manage menu from the Search options.

  2. Select who to make the search active for. These users can access the search from the Search drop-down or the My Items page.

  3. Select who should have the search visible in the left pane.
  4. Select who should have the search shown on the My Assigned page.
  5. Click Finish to save the search and close the wizard.

Saved Searches and Default Values

Adding a filter on a field that is set by a default value can compromise the behavior of the default value. Sometimes this is intentional, but in case it is not, you should be aware of the ramifications.

Example

You might set the Assigned Person for a support case to the person who created it, but filter it to only members of the Support Team. If a customer creates the case, it will not be assigned to them because they are not on the Support Team, but if a support person creates the case, they will be assigned to it automatically. In the case of the customer creating the case, the default value simply would not be set.

This setup might be intentional, but if support people only work on cases in which they are the Assigned Person, this could cause problems. If so, one solution would be to add another filter that sets the default value of the Assigned Person to the support lead if the person who created the case is not on the Support Team. The support lead could then reassign the case as desired.


  • No labels