Condition builder and data types

gpopp
Kilo Expert

Hello!

I have a custom table that contains string fields (among others). I have noticed that for SOME string fields, I have absolutely NOTHING as an operator in the condition builder when I select that field. In others, I have only three choices "is", "Is not", "is anything". A few actually have all of the operators available for a string that I would expect to see from reading the documentation on the wiki:

http://wiki.servicenow.com/index.php?title=Condition_Builder#gsc.tab=0

Can someone explain to me why I'm getting this different behavior for string fields in my table? I need to be able to fashion complex queries against some of these fields and I can't seem to figure out why this is not working. I've looking in the system dictionary and can find no difference between a field that has all 'normal' query operators available and one that does not.

Here's an example of a 'limited' string field:

Condbuilder1.png

Here's an example of a severely 'disenfranchised' string field:

Condbuilde31.png

And here's one that miraculously works as expected:

Condbuilder-working.png

Any clues as to what might be going on would be greatly appreciated!

1 ACCEPTED SOLUTION

gpopp
Kilo Expert

For anyone in the future looking for the answer to this, I believe I have found the root cause.



When I auto created these fields, those that were strings I did NOT assign a size to since the default type is 'String' of length 40. They certainly seemed to create correctly. However, upon further investigation, these fields did NOT default as they do when being entered by hand. They seem to be something called a "Field string" or "Field class" which is derived from the type string but definitely NOT the base type 'String' that we all know and love.



Simply changing the type from blank to 'String' has solved all my problems.


View solution in original post

11 REPLIES 11

I'm not sure I understand. Do you mean the Related Links/Find Record References link? If so, that shows no record references.


gpopp
Kilo Expert

For anyone in the future looking for the answer to this, I believe I have found the root cause.



When I auto created these fields, those that were strings I did NOT assign a size to since the default type is 'String' of length 40. They certainly seemed to create correctly. However, upon further investigation, these fields did NOT default as they do when being entered by hand. They seem to be something called a "Field string" or "Field class" which is derived from the type string but definitely NOT the base type 'String' that we all know and love.



Simply changing the type from blank to 'String' has solved all my problems.