javascript await

gbunce
Kilo Expert

Does anyone know if the 'async' and 'await' operators are valid in ServiceNow? I assume not since they are causing an error but wanted reach out and validate.

2 REPLIES 2

John Longhitano
Kilo Guru

You can create an async business rule.  I believe that would be ServiceNow's version of it.

 

Tony Chatfield1
Kilo Patron

Hi, I don't belive they are compatible.

The current SNC javascript engine is EMCA5
https://docs.servicenow.com/bundle/newyork-application-development/page/script/JavaScript-engine-upg...

Which I assume is the 5th edition
https://en.wikipedia.org/wiki/ECMAScript

The functions await and async were not defined until 2017 - 8th edition
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
https://d...