avinashkashyap
ServiceNow Employee
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-24-2021 10:32 AM
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.
- Click Add Conditional Class.
This brings up a dialog for you to set your conditions and the resulting class. - Set your if condition to “u_type” “is” “computer” and set the output class to “Computer”.
- Click Save.
You do not need to specify an else condition. Your mapping should now look like this: - To set the mapping for a class, click Set Up Map.
- If you need to change the condition, change the target class, or delete the class, click anywhere else in the “Conditional Class” box.
- Repeat this for Network Adapter, IP Address, Software, Software Installation, and Computer Stub.
- For each of these, click Add Conditional Class, fill out the condition and the target class.
- Click Save.
- 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.
You now have 6 classes.
You are ready to start mapping.