Transform map field map script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 04:49 AM - edited ‎01-12-2024 04:49 AM
Hello Experts,
I have written below field map scripting but it's not working can anyone please guide why it's not working.
answer = (function transformEntry(source) {
if(source.u_model=="Apple Macbook Pro 16'' MVVJ2HB/A")
{
var gr=new GlideRecord('cmdb_model');
gr.addEncodedQuery("display_nameSTARTSWITHApple Macbook Pro 16'' MVVJ2HB/A^short_descriptionLIKE32gb");
gr.query();
if(gr.next())
{
return gr.display_name; // return the value to be put into the target field
}
}
else{
return source.u_model;
}
})(source);
thank you.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 05:38 AM
@Mark Wood So, you meant you are still getting the other model instead of the correct one?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2024 05:42 AM
yes, one model is 16 GB and another one is 32 GB I want to set 32 GB.