Catalog variable of Integer - numbers only

Trish Mac
Mega Guru

I'd like to create a catalog variable that allows numbers only and this doesn't appear to be available OOB.  When I search the Community, people are using a variety of scripts for this.  Does something this common really require a script?

Thanks,

Trish

2 ACCEPTED SOLUTIONS

Hello @Trish Mac 

I'm unsure where our disconnect may be, as this is seeming to be more complex than it should be, haha.

 

With that said, what your screenshot provided originally, it did not appear to be saved because you still had the * asterisk icon showing on the "Question" tab, thus telling us it probably wasn't saved. Although, I think if you just filled in the "Question" tab mandatory fields, that may help with more showing in the "Type specifications" tab...so you may want to try to ensure you have all mandatory fields filled in.

 

In any case, unless you all are on some sort of very, very, very old version of ServiceNow...what I'm talking about has been in the system for several versions now.

 

I'll include two screenshots of the settings I just did (again) for you to verify against what you have. You should be able to see more than what your past screenshot shows within the "Type Specifications" tab. If you're still not seeing more there, I would recommend to delete the variable...and try again...or lastly, contact ServiceNow support as something is broken on your end.

 

AllenAndreas_0-1714423332018.png

 

AllenAndreas_1-1714423352734.png

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

Hi,

Glad you were able to see those fields. Out of box, they should all be there so that's a bit concerning that the form was customized that much to have those removed. I would recommend perhaps comparing your catalog item form and tabs to an out of box instance, just to help suggest to whomever if there should be any other fields added or removed from view.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

13 REPLIES 13

Thanks Allan , same confusion with me, now it works perfectly.

Trish Mac
Mega Guru

Hi Allen, the issue was rather a simple one but I didn't catch it.  The fields you were indicating don't appear for me and I had to go into Configure - Form Layout and add some new fields for Type Specifications.  I added Variable Width, Validation Regex, Validation message and Regular Expression.  Then I was able to do exactly as you suggested as well as add a new Validation Regex for my specifications.  Thank you for getting me here.  I'll be accepting your Solution.  Thanks for your time, much appreciated. 

 

Trish

Hi,

Glad you were able to see those fields. Out of box, they should all be there so that's a bit concerning that the form was customized that much to have those removed. I would recommend perhaps comparing your catalog item form and tabs to an out of box instance, just to help suggest to whomever if there should be any other fields added or removed from view.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Trish Mac
Mega Guru

Thanks again, Allen.  Unfortunately, our original implementation was heavily customized by the implementer back in 2018 and we continue to run into issues with items like this.  How would one see an OOB instance?  (Subscribed!  Thanks)

 

Trish