Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Filtering Out Old Intune Data from Service Graph Connector

J-J-J
Tera Contributor

So our particular Intune instance keeps systems that haven't checked in for 9 months before they are purged. This isn't normally an issue, except many of the computers are re-imaged during their lifetime. After they are re-imaged, there are two objects in Intune that now point to a single CI. Due to the long lifetime of the old objects in Intune, we now have items being updated by two Intune objects for 9 months.

I'm trying to have ServiceNow skip/ignore computers in Intune that haven't checked in within the last 2 weeks. We already have the data from them in the CMDB and I don't feel the data from them is particularly useful. I think I can filter these through the IntegrationHub ETL. I've found that I can add before scripts on the SG-Intune Computers data source and these scripts could potentially instruct ServiceNow to skip rows during the import. I've tried access the "lastSyncDateTime" from these scripts and I don't seem to be able to. I've tried referencing them from:

input[0].payload.items[1].values.lastSyncDateTime and input[0].payload.items[1].values.u_lastsyncdatetime and neither seem to exist. I've also tried iterating through the keys to the object under input[0].payload.items[1].values and I don't seem to be able to (Though I know the "name" attribute exists).

Am I heading down the right path for filtering these rows out? If not, would you please point me the correct way?

If I am heading down the right path, any ideas why I can't see the "lastSyncDateTime" or iterate through the attributes on the payload object? Any help here is much appreciated.

Thank you!

0 REPLIES 0