{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":48750,"path":"servicenow-platform/remote-tables/remote-table-script-def-example3.md","title":null,"bundle":null,"doc_type":null,"release":null,"body":"---\ntitle: Example 3: Insert a record in an external source\ndescription: In this example, we create a script to insert an incident record into the external source.\nlocale: en-US\ncanonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/remote-tables/remote-table-script-def-example3.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 3: Insert a record in an external source\n\nIn this example, we create a script to insert an incident record into 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 executeInsert(v_record) {\n\tvar gr = new GlideRecord(\"incident\");\n\tgr.setNewGuidValue(v_record.sys_id);\n\n\tdelete v_record[\"sys_id\"];\n\tgr.number = v_record.u_number;\n\tgr.short_description = v_record.u_short_description;\n\tif (!gr.insert()) {\n\t\tv_record.setLastErrorMessage(\"Error on insert: \" + gr.getLastErrorMessage());\n\t}\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"}}