How to prevent overriding of manual updated data by the data coming from SCCM in HardwareAssettable

Vidya Shree
Kilo Sage

Hi All,

 

We have SCCM integration which is currently populating the records in Hardware asset table, now we are planning to upload all our asset data which are manually maintained in excel sheets. But the problem is SCCM data may show just the last user, which could be a technician setting up the device as the owner rather than the actual owner. So, we do not want SCCM to override the data if we manually update it.

Is there any way to achieve this?

#assetmanagement #SCCM

Thanks,

Vidyashree

4 REPLIES 4

SwarnadeepNandy
Mega Sage

Hi Vidya,

 

This is the perfect use case for reconciliation rule. You can use Reconciliation rules to prevent data update from SCCM.

Make sure while manually updating the records to set the Discovery Source to either import set or manual entry. And then set the order for manual entry lower than SCCM.

You also need to make sure that SCCM update is updating Discovery source as SCCM.

 

https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/configuration-management/r...

 

Kind Regards,

Swarnadeep Nandy

Nancy HP
Tera Contributor

If you are only concerned only about the last logon field, 

 

1. How are you connecting sccm to servicenow. If its thru service graph connector, sccm Primary user name (not the last logged on user) is postulated into assigned to field in cmdb

 

2. You can always set data precedance by updating reconciliation rules. Pls follow servicenow documentation for this 

Hi Nancy, 

 

Thank you for your reply.

Yes, we are using Service Graph connector for SCCM integration.

But I am unable to find where we are mapping Primary user name value to "assigned_to" field. Can you please let me know where we are doing this mapping?

 

Thanks,

Vidyashree

Hello @Vidya Shree ,

Could you please check the data sources , and check the field mappings into it. We have robust transform do confirm at your side.

https://docs.servicenow.com/bundle/vancouver-integrate-applications/page/administer/import-sets/conc...

Please mark helpful.

Let me share you one script which I used to avoid over ride , hope it helps you
Here's an example of such a script:

```
(function executeRule(current, previous /*null when async*/) {
  var asset = new GlideRecord('alm_asset');
  asset.addQuery('sys_id', current.asset.sys_id);
  asset.query();
  
  while (asset.next()) {
    if (!gs.nil(asset.sccm_field) && !gs.nil(current.sccm_field)) {
      // Only override if SCCM has a value
      asset.sccm_field = current.sccm_field;
    }
    
    // Save record
    asset.update();
  }
})(current, previous);
```

Replace `sccm_field` with the actual name of the field you want to protect from being overridden. This script checks whether both fields have a value before updating to ensure that we only update when SCCM has provided a value.