Smartsheet integration with ServiceNow

Joshuu
Kilo Sage

Hi All,

 

I have the below requirement to configure ServiceNow - Smartsheet integration.

 

Whenever few fields in Business Impact Analysis table changes, then the updated field values should be transferred to Smart Sheet.

 

Please assist.

 

Thanks & Regards.

5 REPLIES 5

Anil Nemmikanti
Giga Guru

Hi @Joshuu ,

Here as we are updating the data we can go PUT call, and the PUT call will be executed after updating BR. 

for PUT call we would require data like end point and authentication and request body that is accepted by Thirdparty.

Vishal36
Mega Guru

Hi @Joshuu

This is definitely doable, but there are a few things to sort through before setting up the integration. If you’re trying to sync changes from the Business Impact Analysis table in ServiceNow to Smartsheet, the key is to think about when the update should happen, what exactly needs to move, and how both systems understand that data. Here are a few things to consider before you begin:

  • Which fields should trigger the sync?: If you’re only interested in specific fields (like impact score, owner, or review status), you’ll want to set up a way to detect just those changes.
  • What does a Smartsheet look like?: You'll need to make sure the columns in Smartsheet are mapped to the right fields in ServiceNow — especially if you're updating existing rows, not creating new ones.
  • How should the sync be triggered? Real-time sync is possible, but sometimes teams batch updates every few hours or overnight depending on the case.
  • How are you connecting?: ServiceNow can push data using REST APIs (via Scripted APIs or Integration Hub), and Smartsheet has an API that accepts updates as long as you have the correct row IDs and tokens

You can definitely script this using ServiceNow’s Scripted REST APIs and Smartsheet’s API — it works well if you’re comfortable managing authentication, field mapping, and error handling yourself.

Integration Hub is another option with a low-code approach, but you’ll still need to configure custom triggers and manage logic for each update.

 

However, if you prefer not to maintain scripts or rebuild logic every time something changes, ServiceNow Partner’s integration tools like OpsHub Integration Manager are worth considering. It handles structured, bidirectional sync out of the box — including field-level filtering, event triggers, and traceability — without needing to wire everything manually or writing a single line of code.

Goodluck with your integration! 😊

Chavan AP
Kilo Sage
High-Level Overview
Create a Business Rule
Navigate to System Definition > Business Rules.



Create a new Business Rule:
Name: "Update Smartsheet on BIA Change"
Table: "Business Impact Analysis" [your_table_name]
When to run: "after" update
Filter Conditions: Specify the fields that should trigger this rule.
Advanced tab: Check the "Advanced" box and add a script similar to the following:


(function executeRule(current, previous /*, gs, options*/ ) {

    try {
        var r = new sn_ws.RESTMessageV2('Smartsheet API', 'Update Row');
        r.setStringParameter('sheetId', 'YOUR_SHEET_ID');
        r.setStringParameter('rowId', 'THE_ROW_ID_TO_UPDATE'); // You'll need a way to map the ServiceNow record to the Smartsheet row
        r.setStringParameter('columnId', 'THE_COLUMN_ID_TO_UPDATE');
        r.setStringParameter('newValue', current.getValue('your_field_name'));

        var response = r.execute();
        var responseBody = response.getBody();
        var httpStatus = response.getStatusCode();

        if (httpStatus != 200) {
            gs.log('Smartsheet integration failed. Status: ' + httpStatus + ' Body: ' + responseBody);
        }

    } catch (ex) {
        gs.log('Error in Smartsheet integration Business Rule: ' + ex.getMessage());
    }

})(current, previous);


Best Practices

Error Handling: Implement error handling to log any issues with the API calls.
Testing: Build and test this integration in a sub-production (development or test) environment first.
Dedicated User: Consider creating a dedicated integration user in ServiceNow and Smartsheet for better tracking and security.


Refer: 
https://developers.smartsheet.com/api/smartsheet/openapi
https://www.youtube.com/watch?v=bZT1LYSIomI
https://www.servicenow.com/community/developer-articles/servicenow-rest-api-integration-inbound-with-ease-servicenow/ta-p/2329995

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****

Joshuu
Kilo Sage

Hi @Chavan AP , @Vishal36 , @Anil Nemmikanti ,

 

Thank you for all your responses.

 

I have written the below business rule, and it is working. Here, I am updating the "solution architect" field from "business application" table. And I am able to see the response and also it is getting updated in Smartsheet. 

 

I also need to include few other fields from business application table, one of them is "Production Hosting" which is of type "List" and reference to "sn_apm_hosting_environments_list" table. 

I have tried to add the code as below but unable to update this field getting the below error. 

{
                    "columnId": 4762925636210564,
                    "value": current.u_production_hosting.toString()
}
Smartsheet integration failed. Status: 400 Body: {"refId":"xxxxxxxxxxxxxxxx","errorCode":5536,"message":"CELL_VALUE_FAILS_VALIDATION: The value for cell in column 4762925636210564 did not conform to the strict requirements for type PICKLIST"}

Below is the response which I am getting from postman. How to add this in the script.

 

 
"id": 4762925636210564,
            "options": [
                "AliCloud",
                "Amazon Web Services (AWS)",
                "Azure",
                "CenturyLink (DC4), CenturyLink (SC9)",
                "Google Cloud Platform (GCP)",
                "Installed On Device",
                "On Property (Hotel)",
                "Other",
                "Vendor Hosted (PaaS)",
                "Vendor Hosted (SaaS)"
            ],
            "title": "BR: Hosting",
            "type": "PICKLIST",
(function executeRule(current, previous /*null when async*/ ) {
    var appId = current.number;

    // Call REST Message to get all rows
    var r = new sn_ws.RESTMessageV2('Smartsheet Search Rows', 'get');
    r.setStringParameterNoEscape('sheetId', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    var response = r.execute();
    var responseBody = response.getBody();
    var data = JSON.parse(responseBody);

    var rowId;
    data.rows.forEach(function(row) {
        row.cells.forEach(function(cell) {
            if (cell.columnId == 'xxxxxxxxxxxxx' && cell.value == appId) {
                rowId = row.id;
            }
        });
    });

    if (rowId) {
        // Call REST Message to update the row
        var update = new sn_ws.RESTMessageV2('Smartsheet Update Row', 'put');
        update.setStringParameterNoEscape('sheetId', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

        var body = JSON.stringify([{
            id: rowId,
            cells: [
                {
                    "columnId": 4762925636210564,
                    "value": current.u_solution_architect.toString()
                }
                // Add more fields as needed
            ]
        }]);

        update.setRequestBody(body);
        // Execute the request and capture the response object
        var response = update.execute();
        var responseBody = response.getBody();
        var httpStatus = response.getStatusCode();

        // Check for success (HTTP 200)
        if (httpStatus == 200) {
            gs.info('Smartsheet integration successful. Status: ' + httpStatus + appId);
        } else {
            // Log the full response body of the error
            // so you can see why Smartsheet rejected the update.
            gs.error('Smartsheet integration failed. Status: ' + httpStatus + ' Body: ' + responseBody);
            // This is a more robust way to handle the error
            try {
                var errorBody = JSON.parse(responseBody);
                gs.error('Smartsheet error details: ' + JSON.stringify(errorBody));
            } catch (e) {
                gs.error('Failed to parse Smartsheet error response: ' + e.getMessage());
            }
        }
    } else {
        gs.warn('No row found in Smartsheet for the given App ID.');
    }
})(current, previous);

 

Please assist.

 

Thanks & Regards.