PDA

View Full Version : API Search not handling empty strings


sam.otago
September 21st, 2016, 05:49 PM
Trying to write an asset search using the VB.net API and struggling with empty strings.
One of our fields has values of "Yes", "No" or blank/empty. But when trying to write an AddCriteria expression that brings back "Yes" or blank entries, it's not working.

I thought it would be opNot "No", but that only returns "Yes entries.
I then tried searching for any blank empty using opEqual "", returns nothing.
I then tried searching for any blank empty using opEqual vbNull, returns nothing.

Anyone got any suggestions?

Support Team
September 22nd, 2016, 06:09 AM
It depends how the field is defined. In case it is a Boolean field then only Yes or No will be valid values for the query, however, if the field is textual try using the following constant string when querying $$EMP$$ instead of passing a null string.

Hope this helps.