Servicenow catalog item variable types

Bindhu1
Tera Contributor

Hi All,

 

Do we have a variable of type number in servicenow catalog item OOB?? 

Bindhu1_0-1697031959879.jpeg

like here they should only enter numbers.

 

Thanks

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Bindhu1 

OOB variable validation regex is there for number

AnkurBawiskar_0-1697033182151.png

Then attach it to your text variable

AnkurBawiskar_1-1697033246676.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

RaghavSh
Kilo Patron

There is no number type variable in servicenow but this can be achieved with single line text variable in multiple ways.

1. Using regex. Reefer : https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/product/service-catalog-managem... 

2. Refer : https://www.servicenow.com/community/developer-forum/allow-only-numeric-data-in-a-single-line-field/... 

 


Raghav
MVP 2023

Sagar Pagar
Tera Patron

Hi @Bindhu1,

 

You need to use Single line text variable with Number variable regex for number validations.

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

Ankur Bawiskar
Tera Patron
Tera Patron

@Bindhu1 

nope

you need to use string variable and then use regular expression on that variable to ensure user enters only digits

You can use OOB variable validation regex for this

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Bindhu1 

OOB variable validation regex is there for number

AnkurBawiskar_0-1697033182151.png

Then attach it to your text variable

AnkurBawiskar_1-1697033246676.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader