API filter on on dropdown value

Sugar Professional 7.6.0

So there are a number of resources that talk about how to check if a field equals, contains, etc. values.   None of those resources talk about how to check if a drop down has a value.  

The two filters that I cannot seem to get to work are:

{
  "filter":[
       {//Territory is a dropdown that contains a large number of values. I just want to make sure to get the ones where the value is set
            "territory_c":{
                 "$not_null"
            }
       }
  ]
}
{
  "filter":[
       { //There are a number of account types, I only want one account type. 
            "account_type":{
                 "$in":{"hospital"}
            }
       }
  ]
}
  • Hi Mary,

    Here is how I would get those two filters working:

    {  
      "filter":[  
           {//Territory is a dropdown that contains a large number of values. I just want to make sure to get the ones where the value is set  
                "territory_c":{  
                     "$not_null":""  
                }  
           }  
      ]  
    }  
    {  
      "filter":[  
           { //There are a number of account types, I only want one account type.   
                "account_type":{  
                     "$equals":"hospital"
                }  
           }  
      ]  
    }  
    

    Let me know if that gets it working for you!

    -Alan