Topic
  • 1 reply
  • Latest Post - ‏2016-02-16T19:05:14Z by Rob W Davis
Rob W Davis
Rob W Davis
2 Posts

Pinned topic Quering Assets for a specific value (filter syntax)?

‏2016-02-16T17:15:42Z |

Hello all,

 

I'm trying to build an asset query through the api that will give back a list of fields.  However, I'm having trouble with the proper filter syntax to test against a specific property.

I want to list the Asset id when the property value = "MyHostName"

 

I'm using my browser and the api_doc to test this out

 

My Parameters are:

fields id, properties(value)

filter id=1115

I get the following

[
  {
    
"id": 
1115,
    
"properties": [
      {
        
"value": 
"MyHostName"
      }
    ]
  }
]

However, I want to filter based on the host name and list the fields in the record that matches.  I've tried the following as filters and am getting syntax errors.

 

filter properties(value) = "MyHostName"

filter properties.value = "MyHostName"

filter properties.value() = "MyHostName"

filter properties(value()) = "MyHostName"

 

What is the correct syntax for this filter?

 

Thank you,

Rob

  • Rob W Davis
    Rob W Davis
    2 Posts
    ACCEPTED ANSWER

    Re: Quering Assets for a specific value (filter syntax)?

    ‏2016-02-16T19:05:14Z  

    I just found out the proper syntax for the filter.

     

    the proper filter should be as follows

     

    properties contains name = "MyHostName"

     

    The "contains" test required because this is a list and not a single value.

  • Rob W Davis
    Rob W Davis
    2 Posts

    Re: Quering Assets for a specific value (filter syntax)?

    ‏2016-02-16T19:05:14Z  

    I just found out the proper syntax for the filter.

     

    the proper filter should be as follows

     

    properties contains name = "MyHostName"

     

    The "contains" test required because this is a list and not a single value.