Ignore records with Null username coming through JAMF connector

Prashant62
Tera Contributor

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.

1 ACCEPTED SOLUTION

Yogesh11bhatt
Kilo Guru

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.

  1. Navigate to IntegrationHub ETL in your ServiceNow instance.

  2. Open your Service Graph Connector for JAMF ETL definition.

  3. Go to Step 3: CMDB Classes to Map.

  4. Locate the specific CI Class you want to prevent from being created (e.g., the User or Computer class).

  5. Click the Condition icon (it looks like a funnel/filter) next to that class.

  6. Set the condition to only run if the username is present. For example:

    • [Username] is not empty

  7. 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:

  1. In IntegrationHub ETL, go to Step 2: Preview and Prepare Data.

  2. Click Add Operation and select Script Operation.

  3. Pass your incoming JAMF Username column as the input variable (e.g., jamf_user).

  4. Write a simple return script:

    JavaScript
     
    if (jamf_user === '' || jamf_user === null || jamf_user === undefined) {
        return false; 
    }
    return true;
  5. Map the output of this script to a new custom column called Has_Username.

  6. 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,

View solution in original post

5 REPLIES 5

Tanushree Maiti
Tera Patron

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)
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

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!

Yogesh11bhatt
Kilo Guru

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.

  1. Navigate to IntegrationHub ETL in your ServiceNow instance.

  2. Open your Service Graph Connector for JAMF ETL definition.

  3. Go to Step 3: CMDB Classes to Map.

  4. Locate the specific CI Class you want to prevent from being created (e.g., the User or Computer class).

  5. Click the Condition icon (it looks like a funnel/filter) next to that class.

  6. Set the condition to only run if the username is present. For example:

    • [Username] is not empty

  7. 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:

  1. In IntegrationHub ETL, go to Step 2: Preview and Prepare Data.

  2. Click Add Operation and select Script Operation.

  3. Pass your incoming JAMF Username column as the input variable (e.g., jamf_user).

  4. Write a simple return script:

    JavaScript
     
    if (jamf_user === '' || jamf_user === null || jamf_user === undefined) {
        return false; 
    }
    return true;
  5. Map the output of this script to a new custom column called Has_Username.

  6. 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,

Hi @Yogesh11bhatt , Thanks for looking into this.

I was trying to edit the conditional class by giving condition as username is not empty but I am getting a pop-up that changing the class will delete any mapping set for these classes.

Prashant62_0-1779720973255.png