Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Field Mapping

NARASIMHA REDD5
Tera Contributor

Hi Team,
Good Morning.

"I am facing an issue with mapping the field from source to target. We have a 'monitor' field on the CMDB form. I attempted to map the value, but instead of 'true' or 'false', I am receiving '0' or '1'. How can I resolve this issue?"

 

NARASIMHAREDD5_0-1708756479669.pngNARASIMHAREDD5_1-1708756546000.png

 

22 REPLIES 22

May I know what type of field you have chosen for 'is Monitored' ?

 

Is it true or false choice, yes or no or it's a integer type ?

 

Try this : 

 

 

answer = (function transformEntry(source) {
    if (source.getValue('monitor') == '1') {
        
target.u_is_monitored = true;

    } else if (source.getValue('monitor') == '0') {
target.u_is_monitored = false;

    }


})(source);
;

 

 

You can update the value to 0 & 1 in dictionary.


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Sohail Khilji 

Thanks for quick Response. The Field Is Boole along with true/false choices.

Please change the type of field to True/False or create a choice field with true and false value...

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Sohail Khilji 

Still I am getting same

can you brief your source and taget fields a little bit more... ? i need a over view on what your trying and were the isssue is ...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect