- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 09:37 AM
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:
Here's an example of a severely 'disenfranchised' string field:
And here's one that miraculously works as expected:
Any clues as to what might be going on would be greatly appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2015 05:54 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 01:11 PM
Hello Gregory,
In the filter for Label field (2nd snapshot from the top), there appears a Reference look up option. Click on that and see what is showing in the next window. You will get some idea of this unexpected behavior.
Maybe the Column label/name is creating some conflict! Because, if you notice, there is a related list named as 'Label' inside the dictionary entry. Maybe system is mixing up with the custom field. Otherwise, there should not be any reference look up option in the filter for a string field.
Thanks,
Subhankar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 01:14 PM
Hi Subhankar,
Yes, the name 'Label' was causing one of the problems. I've changed it now to "Feed Label" but I still don't get full string query operators. Just "is", "is not", and "is anything".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 01:18 PM
Even if you change the label, the column name remains same. I would suggest leave the field. Create another field and use it.
Also, before changing anything check through the reference look up and see where it is referring. Then, we may get the root cause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 01:26 PM
Yes, I am thinking I will have to create another field, move the data, and delete this field. It is frustrating not knowing why this (and other) fields are behaving this way.
Thank you for your suggestions!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2015 01:32 PM
Have you checked the Reference look up option and seen where it is referring?
I feel it would refer to 'Field Label' table. Check once.