Comparators
Comparators are tools that you use to search and retrieve records by combining two or more criteria. A combination of comparators and fields are used in searches to narrow the results to a very small group of students at your school. There are many operators or "comparators," but some of the most common are included in this section.
A simple example of a search using a comparator is last_name=jones. This is called a search command because you are commanding PowerSchool to perform a search that contains that particular line of text. In other words, you are telling the PowerSchool system to find all students whose last name is Jones. All search command lines are broken into three parts:
- Field name: last_name, first_name, or student_number
- Comparator: =, #, >, or <
- Search argument or value: Jones, becky, or 2301923
The general format is:
[field name][comparator][search argument]
How to Use Comparators
The following are some of the most common comparators.
= Comparator
Use this comparator to search for records that are the value of the field. Suppose you want to find all students in your school with the last name of Jones. Find them with the following search command:
last_name=Jones
This instructs PowerSchool to go through each student record and return those records that have Jones in the last_name field.
< Comparator
Use this comparator to search for records that are less than the value of the field. Suppose you want to find all students in your school who are in a grade level less than 12th grade. Find them with the following search command:
grade_level<12
This instructs PowerSchool to go through each student record and return those records that have any value less than 12 in the grade_level field.
> Comparator
Use this comparator to search for records that are greater than the value of the field. Suppose you want to find all students in your school who are in a grade level greater than 9th grade. Find them with the following search command:
grade_level>9
This instructs PowerSchool to go through each student record and return those records that have any value greater than 9 in the grade_level field.
<= Comparator
Use this comparator to search for records that are less than or equal to the value of the field. Suppose you want to find all students in your school who are in a grade level less than or equal to 12th grade. Find them with the following search command:
grade_level<=12
This instructs PowerSchool to go through each student record and return those records that have any value less than or equal to 12 in the grade_level field.
>= Comparator
Use this comparator to search for records that are greater than or equal to the value of the field. Suppose you want to find all students in your school who are in a grade level greater than or equal to 10th grade. Find them with the following search command:
grade_level>=10
This instructs PowerSchool to go through each student record and return those records that have any value greater than or equal to 10 in the grade_level field.
# Comparator
Use this comparator to search for records that are not the value of the field. Suppose you want to find all students in your school who are not in 12th grade. Find them with the following search command:
grade_level#12
This instructs PowerSchool to go through each student record and return those records that do not have 12 in the grade_level field.
"in" Comparator
Use this comparator to verify that the value of the field matches any argument in the list you provide. For example, if you want a list of all the ninth, tenth, and eleventh graders at your school, enter the following search command line:
grade_level in 9,10,11
In this example, the field is grade_level, the comparator is "in," and the search argument is 9,10,11. Note that the items in the argument are separated with commas. This tells PowerSchool to find all students in grade levels 9, 10, and 11. PowerSchool goes to the grade_level field in each student record and returns the records where the entry is 9, 10, or 11.
"contains" Comparator
Use this comparator to search for records that have the value of the field. Suppose you want to find all students in your school who live on Cherry Lane. Find them with the following search command:
mailing_street contains Cherry Lane
This instructs PowerSchool to go through each student record and return the records that have Cherry Lane in the mailing_street field. It does not matter if the value of a student's mailing_street field is 194 Cherry Lane or 24230 Cherry Lane Parkway. If Cherry Lane appears anywhere in the field, PowerSchool considers it a match and includes the record in the search results.
Note: You cannot use the contains comparator for numerical fields, such as student numbers.
"!contain" Comparator
The opposite of the contains comparator is "!contain." Use this comparator to find records that do not have the value of the field. Perhaps you want to find all students in your school whose phone numbers does not contain the number five. Use the following search command:
home_phone !contain 5
This instructs PowerSchool to go through each student record and return the records that do not have 5 in the home_phone field. It does not matter if the number is in the area code, the prefix, or the phone number. If there is not a 5 in the home_phone field, PowerSchool considers it a match and includes the record in the search results.
"@" (Wildcard) Comparator
Suppose you want to find all students whose first names start with "rob." This includes anyone named Rob, Robert, Robbie, Robby, Robin, or Roberta. To find these students, enter the following in the search field:
first_name=rob@
As you can imagine, the wildcard is a very powerful comparator. There is no rule as to where you place it in the command. It can be used anywhere to take the place of a letter, word, or phrase. Enter first_name=@ie to find student whose first name ends in "ie." This search produces results like Terrie, Debbie, or Eddie but not Terry, Debby, or Eddy. The command first_name=s@n produces results with names such as Susan or Stan.
Note: You cannot use the @ or wildcard comparator for numerical fields, such as student numbers.