The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to make a report and add a condition to fetch values smaller than 10000 on the field alphanumeric

martinpersoroux
Tera Expert

How to make a report and add a condition to fetch values smaller than 10000 on the field alphanumeric.

Is it possible ?

3 REPLIES 3

darius_koohmare
ServiceNow Employee
ServiceNow Employee

The condition builder condition for 'less than or is' 9999 should work for you.


See this example I tested below:


Screen Shot 2017-05-30 at 1.10.42 PM.pngScreen Shot 2017-05-30 at 1.10.56 PM.png


Shiva Thomas
Kilo Sage

Bonjour Martin,



I tried Darius approach, but it did not work for me...


Capture d



I experimented using a custom dynamic filter, but failed to get results.



Previous versions of the Now platform had a 'MATCHES REGEX' condition in the filter. Regular Expressions would have been a perfect solution for you!



pastedImage_0.png



Sadly the RegExp condition seems to have been removed some years ago. I think it was quite buggy and caused many issues... There are some old discussions on the subject in the Community (ex: Matches Regex in Condition Builder). Some of those, they also mention the use of RegExp with 'CONTAINS' but I was not able to replicate. I think this is not supported anymore.



Conclusion, I got no answer for you, even after one hour of experimentation.


Shiva Thomas
Kilo Sage

Bonjour Martin,



Since string field can't be filtered/ordered for their numeric value, the solution is to work with an integer field . Here is what I did...



Create a new custom field, like 'u_numeric_description' of type integer. Make it read only.


Create a new business rule, like 'Set Numeric Description' and make it run on insert and update, when Short Description changes.


From the business rules set the 'u_numeric_description' with this JavaScript


javascript: parseInt(current.short_description)


Capture d


Capture d



Now you only have to update your reports' filter to use the Numeric Description instead... And the Less Than condition will work!


Capture d



Victory at least!