avinashkashyap
ServiceNow Employee
ServiceNow Employee

Conditional Mapping 

It is likely that your data does not need to create every class for each row. You might also have scenarios where your data conditionally maps to a specific class. This can be accomplished through conditional mapping. 

Since you are working with multiple data types: Computers, Network Adapters, and Software, you are using conditional classes. The logic is as follows: 

  • If type is a computer, create a Computer class 
  • If type is a network, create a Network Adapter 
  • If type is network and there is an IP address, create an IP Address 
  • If type is software, create a Software 
  • If type is software, create a Software Instance 
  • If type is software or network, create a Computer Stub. This is used as a reference in the relationships. See the section Stub Records under mapping for more information. 

find_real_file.png

  1. Click Add Conditional Class 
    This brings up a dialog for you to set your conditions and the resulting class.find_real_file.png 
  2. Set your if condition to “u_type” “is” “computer” and set the output class to “Computer”. 
  3. Click Save 
    You do not need to specify an else condition. Your mapping should now look like this: find_real_file.png
  4. To set the mapping for a class, click Set Up Map 
  5. If you need to change the condition, change the target class, or delete the class, click anywhere else in the “Conditional Class” box. 
  6. Repeat this for Network Adapter, IP Address, Software, Software Installation, and Computer Stub.  
  7. For each of these, click Add Conditional Class, fill out the condition and the target class. 
  8. Click Save. 
  9. If type is a network, create a Network Adapter. find_real_file.png
  10. If type is network and there is an IP address, create an IP Address. find_real_file.png
  11. If type is software, create a Software. find_real_file.png
  12. If type is software, create a Software Instance. find_real_file.png
  13. If type is software or network, create a Computer Stub.  
    This is used as a reference in the relationships. See the section Stub Records under mapping for more information.find_real_file.png 

You now have 6 classes. 

find_real_file.png 

You are ready to start mapping.  

Version history
Last update:
‎08-24-2021 10:32 AM
Updated by: