Flow Designer Field Mapping

Mark Wood
Tera Contributor

Hello Experts,

I am using ServiceNow flow designer. There are two tables event table and work order .event table has a severity field which has 5 choices critical, major, minor, warning, and ok for work order table has a priority field which has five options critical, high, moderate, planning, and low. now I want to map these five fields of priority to the severity field. when the event is created with high severity work order should be created and the priority of the work order should be the same as the severity. I have attached a screenshot below.please guide me.

thank you.

2 REPLIES 2

Elijah Aromola
Mega Sage

You can create a custom mapping and return the value for that field. Click the script icon on the priority line that has the "</>" brackets in it. 

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

 

Hello @Elijah Aromola thanks for your response.

I am using Subflow Whatever you mentioned In this thread I followed it but still not working Can you please me what mistakes I am making? i have attached a toggle scripting screenshot below. and one more don't i need to pass backend value in JOSN or the label name?

/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**Available options display upon pressing "." after fd_data
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var mapObj = {
"critical": "1",
"major": "high",
"minor": "moderate",
"warning": "planning",
"ok": "low",
}

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