I would like to create currency field

Bird1
Mega Sage

Hello,

I would like to set this field to be currency format automatically. 

It means if I enter '10000', it will auto convert to 10,000.00. If I enter '1000000', it will auto convert to '1,000,000.00'. This field will not allow user to manually type comma , and it could support 2 decimal. 

The value cannot be exceed than 999,999,999.99.

 

Could anyone help?

 

find_real_file.png

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if this is for catalog item you can use variable validation regular expression for this and link to that variable

Regards
Ankur

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

Yes, it's record producer. Could you please advise the regular expression to fit this requirement?

 

  • The value cannot be exceed than 999,999,999.99
  • Auto adding decimal on the currency
  • Auto adding comma on the currency

Hi,

you can validate point 1 using regex

but for other 2 points you would require onChange client script to set the value

Remember you are writing onChange on same variable and setting same variable value so ensure it doesn't go in loop

Regards
Ankur

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

@Bird 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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

@Bird 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

 

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