In this video we will walk through the exercise 4 solution step by step. First let's go to the
exercise 4 folder in the postman collection. We have six requests to write using various AF search
methods. For each request we will need to specify two URL parameters: first the database web ID in
our case for the NuGreen database this is already supplied in each of our requests; the second URL
parameter is the query string. This parameter uses AF search query syntax. There's a help page
discussing this query syntax and showing which fields are supported for each type of search.
For our first query we want to return elements that have B - 2 in the name and
are based on the template boiler so our query parameter will have two criteria.
Our second search is again for elements in the NuGreen database. This time we want to search
for elements based on the pump template that also have specific attribute values; this is
an example of something we could not do with index search but we can do using the AF search method.
Our query parameter will have three criteria: template name and then two attribute values.
The pipe notation signifies that we're referring to the attribute of the element and we can be
sure that our elements have those attributes because we've specified the pump template.
Next we will search for AF attributes that have flow in their name and are under an element based
on the unit template. To apply a criterion for the element we can use the following syntax with
curly braces and outside the braces we will put the name filter for the attribute itself.
For number four we have another attribute search this time to get all PI point data
reference attributes for boiler elements under a parent element of new grain Tucson
milling process. Again we'll have the criterion for the element inside
the curly braces and the attributes plug in filter will go outside of the curly braces.
Our next search is using the event frame controller to retrieve event frames based
on the template OSI Unit procedure with a batch ID attribute value of 1004. This query
is similar to the one for question 2 where we specified an attribute value on an element.
The last question asks us to return the five most recent event frames where the severity
was critical. To do this we need criteria to specify the severity and also to return
the events sorted by start time in descending order meaning the most recently started about
frames will come first. We'll then add a max count parameter to limit the number of
results to five outside of the query string just as we have done for other endpoints.