Using GET input to search in a PowerSchool custom page

As far as I can tell based on what scant documentation there is for PowerSchool custom pages, on trial and error, and on PowerSchool forum responses, there doesn't appear to be a way to use a not-equal-to comparison operator. Any PowerSchool power users who want to correct me—I'd love to be wrong about this.

If you want to use GET input in your PowerSchool custom page, you can, of course, create an HTML form. But how do you reference that input and then use it in a ~[tlist_sql] query only if the input exists?

First of all, to reference a GET variable, you use gpv. For example, let's say your custom page with the GET input is something like https://yourschool.powerschool.com/admin/reports/yourcustompage.html?parentlastname=wong

In that case, to reference parentlastname, you would use ~(gpv.parentlastname)

If you wanted to run a ~[tlist_sql] query only if the input exists—and, again, this is only because I can't find anything on how to use a not-equal-to comparison operator for custom pages—you would essentially use the logic of "If it's equal to blank, do nothing; otherwise, do this query."

Here's an example (you would put in your own SQL query, of course):

~[if.~(gpv.parentlastname)=]
[else]
~[tlist_sql; SELECT firstfield, secondfield, thirdfield
FROM tableyoureusing
WHERE somefield='~(gpv.parentlastname)']
~(firstfield), ~(secondfield), ~(thirdfield)
[/tlist_sql]
[/if]
So when you load the page the first time, it will see that ~(gpv.parentlastname) doesn't exist (or that it is equal to blank) and not run the ~[tlist_sql] query. After the user submits the search and the search term comes back as GET input, the page will run the query.

Leave a Reply

Your email address will not be published. Required fields are marked *