We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Get variable display value for CMDB record creation

MichaelS4451727
Tera Expert

Hello,

Software engineering student here taking my first JavaScript class and I have been tasked with some work in SN Flow Designer. Basically what I need to do is to create a CMDB entry in a Flow Designer using the variables from the Catalog Item. Some of the fields are easy and map to a variable, but other variables, such as drop downs and reference fields are not so straightforward. Can someone please help me out with how I would script these variables?

 

michael_smith_0-1727891075760.png

For example, here I would need to populate the Circuit type field with the display value of a selectbox variable type.

 

Also any resource recommendations I should be looking at for scripting in ServiceNow as I grow my JavaScript skills would be super appreciated.

1 REPLY 1

debendudas
Mega Sage

Hi @MichaelS4451727 ,
Please refer to this: Flow Designer Field Mapping - ServiceNow Community

var mapObj = {
"critical": "critical",
 "major": "high",
 "minor": "moderate",
 "warning": "planning",
 "ok": "low",
}

return mapObj[fd_data...] // need to update the fd_data.enter_path_here_to_get_severity

 

If this solution helps you then, mark it as accepted solution ‌‌✔️ and give thumbs up 👍