Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Web API Reference

EventFrame CreateSearchByAttribute

EventFrame CreateSearchByAttribute

Create a link for a "Search EventFrames By Attribute Value" operation, whose queries are specified in the request content. The SearchRoot is specified by the Web Id of the root EventFrame. If the SearchRoot is not specified, then the search starts at the Asset Database. ElementTemplate must be provided as the Web ID of the ElementTemplate, which are used to create the EventFrames. All the attributes in the queries must be defined as AttributeTemplates on the ElementTemplate. An array of attribute value queries are ANDed together to find the desired Element objects. At least one value query must be specified. There are limitations on SearchOperators. See Search Operator for more information.

Request

POST eventframes/searchbyattribute

URL Parameters

  • noResults

    If false, the response content will contain the first page of the search results. If true, the response content will be empty. The default is false.

  • webIdType

    Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType". See WebID Type for more information.

  • selectedFields

    List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.

Body Parameter

The query of search by attribute.

Status Codes

201: The link is stored in the response's "Location" header. The response content is the first page of the search result by the default parameters.

400: Empty or invalid request content.

413: Request content is too large.

Sample Request Body


            {
                "SearchRoot":"I1FmDqD5loBNH0erqeqJodtALADqD5loBNH0cAAAAAAASwAg",
                "ElementTemplate":"I1ETDqD5loBNH0erqeqJodtALAkpSYp6uykE2Ku0yChDU91g",
                "ValueQueries":
                [
                    {
                        "AttributeName":"City",
                        "AttributeValue":"Philadelphia",
                        "SearchOperator":"Equal"
                    },
                    {
                        "AttributeName":"Model",
                        "AttributeValue":["ModelA", "ModelB", "ModelC"],
                        "SearchOperator":"In"
                    },
                    {
                        "AttributeName":"Pressure",
                        "AttributeUOM":"pound-force per square inch",
                        "AttributeValue":40.0,
                        "SearchOperator":"LessThan"
                    }
                ]
            }
            
In This Topic
TitleResults for “How to create a CRG?”Also Available in