{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":48752,"path":"servicenow-platform/remote-tables/remote-table-script-def-example5.md","title":null,"bundle":null,"doc_type":null,"release":null,"body":"---\ntitle: Example 5: Delete a record in an external source\ndescription: In this example, we create a script to delete an incident record from the external source.\nlocale: en-US\ncanonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/remote-tables/remote-table-script-def-example5.html\nrelease: australia\nproduct: Remote Tables\nclassification: remote-tables\ntopic_type: reference\nlast_updated: \"2026-03-12\"\nreading_time_minutes: 1\nbreadcrumb: [Create script definitions, Remote tables, Manage instance data sources, Extend ServiceNow AI Platform capabilities]\n---\n\n# Example 5: Delete a record in an external source\n\nIn this example, we create a script to delete an incident record from the external source.\n\nFor Remote Table API information, refer to:\n\n-   [v\\_query – Scoped, Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/v_queryAPI.md)\n-   [v\\_record - Scoped, Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/v_recordAPI.md)\n-   [v\\_table – Scoped, Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/v_tableAPI.md)\n\n```javascript\n(function executeDelete(v_record) {\n\n     var gr = new GlideRecord('incident');\n     if (gr.get(v_record.sys_id)) {\n         gr.deleteRecord();\n     } else {\n         v_record.setLastErrorMessage(\"Record not found\");\n     }\n })(v_record);\n```\n\n**Parent Topic:**[Create script definitions for a remote table](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/remote-tables/create-remote-table-script.md)\n\n"}}