Common transform map for multiple data sources

Overview

Service-Now has a CMDB module which has almost all types of assets init. cmdb_ci is the base table for all assets. Same applies to Service-Now tickers, task is the base table. Mostly these base tables has all the common fields. Data created / added in CMDB has some what similar fields. If we want to import data into system using excel file or any other file or data source (SQL, Oracle etc.)  one needs to create Data Source and  transform map and mapping source fields with target fields. Creating and maintaining transform map for all assets becomes painful process when removing common columns from all asset transform map.
To over come this issue a common transform map is created. Create a data source called "LinuxServer Data Source".  In Import Set table label add name "Common Import Set Table". For now we consider, each server data is fetched from different table. So to add queries appropriately we create multiple data sources like "Win Data Source", "IBM Data Source" etc. but the Import used for these data sources are common that is "Common Import Set Table". If the data is pulled from any database make sure column "devide_type" with default value is added. We need this column later to re-set transform map  target table dynamically.
SELECT name, vendor, CPU, 'cmdb_ci_linux_server' AS device_type
FROM [ table_name ]
Pull data into "Common Import Set Table" by clicking on "test load 20 records". It will create source table in Service-Now instance with all columns and 20 records. Create Transform Map "Common Transform Map" as shown below.
Select source table "Common Import Set Table". Click "Run Script" checkbox to write script which will be executed before processing a row. So this script will run on before transformation of each row.
var sysClass = source.u_device_type.toString();
if (JSUtil.notNil(sysClass))
{
 target.sys_class_name = sysClass;
}
Above code will change the target table of transform map at run time. Once field mapping is done the records will be updated in the Linux Server of Service-Now CMBD table.

So far records are populated in Linux Server with common fields. Now we need to populate Linux Server specific columns as well. e.g. "u_service_level" is a Linux Server specific column which is created on "cmdb_ci_linux_server" table. This field is not available in field mapping as the target table is re-set dynamically. Hence we need to write a script onAfter event of transform map
var deviceType = source.u_device_type.toString();
if (deviceType == 'cmdb_ci_linux_server')
{
 // Fech class name from target
 var v_ClassName = target.sys_class_name.toString();  
 
 // Create a glide record  
 var grServer = new GlideRecord(v_ClassName);           
 grServer.addQuery("sys_id", target.sys_id.toString());
 grServer.query();
 if (grServer.next())
 {
  grServer.u_service_level = source.u_service_level.toString();
  grServer.update();
   }
} 

33 comments:

  1. Service Now | 21st Century Software Solutions
    www.21cssindia.com/servicenow
    Introduction to Service Now. Introduction to service now instances & Process; b) SNC Navigations; c) SNC Applications and Modules; d) Forms,Lists and Tables ...

    Training is an costly Affair …….But what if it is done Online at the convenience of the Trainer & the Trainee sitting in any part of the World……….

    Thats what 21cssindia Makes Possible.
    . send ur enquiry to contact@21cssindia.com. or Call +917386622889

    ReplyDelete
  2. ServiceNow - Layman Learning
    laymanlearning.com/servicenow Cached
    ServiceNow Training Courses: ServiceNow Accredited Administration Training ITIL® Accredited Training & Certification ITSM (Apollo) Simulation ISO20000 COBIT Six ...

    ReplyDelete
  3. Really it was an excellent blog it have more and more servicenow online training

    ReplyDelete
  4. SV Soft Solutions is offering best servicenow online training with 100% job assistance and high quality training facilities and well expert faculty .
    to Register you free demo please visit Servicenow Online Training Institute with Job Support

    ReplyDelete
  5. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work..

    servicenow online training bangalore

    ReplyDelete

  6. the blog is about Common transform map for multiple data sources it is useful for students and servicenow Developers for more updates on servicenow follow the link

    ServiceNow Online Training

    For more info on other technologies go with below links

    tableau online training hyderabad

    mulesoft Online Training

    Python Online Training

    ReplyDelete
  7. well done the blog is great and it is about Common transform map for multiple data sources it is useful for students and servicenow Developers for more updates on servicenow follow the link

    ServiceNow Online course

    For more info on other technologies go with below links

    tableau online training hyderabad

    Python Online Training

    mulesoft Online Training

    ReplyDelete
  8. Fabulous information you have shared about ServiceNow, thanks for that and share more content on ServiceNow Online Training

    ReplyDelete
  9. This information is really awesome thanks for sharing most valuable information.
    ServiceNow Training in Hyderabad

    ReplyDelete
  10. Wow it is really wonderful and awesome thus it is veWow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your site.ry much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your site.servicenow training in bangalore

    ReplyDelete
  11. Here is the best music to calm and relax your mind

    1. best relaxing music
    2. best Depp sleep music
    3. best meditation music
    4. best calm music
    5. best deep focus music

    ReplyDelete
  12. "Discover the best best tableau coursesto master data visualization and analytics. Enhance your skills with top-rated training designed for all levels."

    ReplyDelete
  13. "Enhance your data visualization skills with expert Tableau training india onlineJoin interactive sessions designed for beginners and professionals to master Tableau from anywhere in India."

    ReplyDelete
  14. "Enhance your data skills with our Tableau developer course onlinedesigned for beginners and professionals to master interactive dashboards and visual analytics. Learn at your own pace with expert guidance and real-world projects."

    ReplyDelete
  15. "Enroll in our power bi courseto learn interactive dashboards, data visualization, and business intelligence techniques."

    ReplyDelete
  16. "Boost your data skills with the best power bi coursedesigned for beginners and professionals alike. Learn to create interactive dashboards, visualize data, and make informed decisions confidently."

    ReplyDelete
  17. "Enhance your data analysis skills with our power bi online trainingdesigned for beginners and professionals alike. Learn to create interactive dashboards, reports, and visualizations from anywhere online."

    ReplyDelete
  18. "Join our power bi classes online to master data visualization and business analytics from anywhere. Learn interactive dashboards, reports, and insights at your own pace."

    ReplyDelete
  19. "Join our salesforce administrator classesto gain hands-on experience and master Salesforce administration for professional growth."

    ReplyDelete
  20. "Enroll in our sales force admin course to master Salesforce administration from scratch. Gain hands-on experience and become a certified Salesforce professional."

    ReplyDelete
  21. "Enhance your career with business analyst course online gaining hands-on skills to manage Salesforce efficiently.
    Learn to customize, automate, and optimize Salesforce workflows through expert-led SFDC Admin Training."

    ReplyDelete
  22. "Enroll in the salesforce admin course onlineonline and gain hands-on skills to manage Salesforce efficiently and advance in your IT career."

    ReplyDelete
  23. "Join our salesforce admin trainingto learn practical administration techniques and become a certified Salesforce professional."

    ReplyDelete
  24. "Enhance your career with our salesforce development coursedesigned for beginners and professionals alike. Learn to build, customize, and manage Salesforce applications efficiently."

    ReplyDelete
  25. classes in tableau let you group related dimension members into categories based on shared characteristics or rules. They simplify analysis by organizing data into meaningful segments that can be reused across multiple views.

    ReplyDelete