Ignore records with Null username coming through JAMF connector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
52m ago
We have an existing implementation of ServiceGraph connector for JAMF in our environment and we are trying to restrict the jamf records that are coming with empty Username values.
As the ServiceGraph uses robust transform, I am looking for a way to achieve this.
Any help on this is highly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13m ago - last edited 12m ago
Hi @Prashant62
If you have transform map in place, just add an onBefore transform script:
(function runTransformScript(source, map, log, target) {
if (gs.nil(source.user_name) || source.user_name == '') //update source field name with actual one
{ ignore = true; } })(source, map, log, target)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3m ago
Just chiming in to add that ignore = true; scripts do not work on Service Graph Connectors. Since the JAMF connector is built on the Robust Transform Engine (RTE) and IntegrationHub ETL, legacy Transform Map scripts will be ignored by the system. You'll need to use the ETL conditional mapping instead!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4m ago
Hi @Prashant62 ,
The best practice for Service Graph Connectors is to handle this using the built-in conditional logic in IntegrationHub ETL—no scripting required.
Navigate to IntegrationHub ETL in your ServiceNow instance.
Open your Service Graph Connector for JAMF ETL definition.
Go to Step 3: CMDB Classes to Map.
Locate the specific CI Class you want to prevent from being created (e.g., the User or Computer class).
Click the Condition icon (it looks like a funnel/filter) next to that class.
Set the condition to only run if the username is present. For example:
[Username] is not empty
Save and activate your ETL definition.
By doing this, the Robust Transform Engine will process the incoming JAMF payload but will simply skip creating or updating that specific record if the username value is missing.
The Low-Code Alternative: RTE Script Operation
If your requirement is strictly to drop the entire row of data before it even reaches the mapping phase, you can flag it in the preparation stage:
In IntegrationHub ETL, go to Step 2: Preview and Prepare Data.
Click Add Operation and select Script Operation.
Pass your incoming JAMF Username column as the input variable (e.g., jamf_user).
Write a simple return script:
JavaScriptif (jamf_user === '' || jamf_user === null || jamf_user === undefined) { return false; } return true;
Map the output of this script to a new custom column called Has_Username.
Go to Step 3: CMDB Classes to Map, click the filter icon on your main classes, and set the condition to: [Has_Username] is true.
Bottom Line: Discard the legacy onBefore script you found online. Use IntegrationHub ETL conditions to filter out the empty values safely and correctly.
Please mark this response as helpful if it guided you in the right direction.
Regards,