---
sourceDocument: Australia ServiceNow AI Platform Capabilities
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/servicenow-platform

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Example 4

# Example 4: Update a record in an external source {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

In this example, we create a script to update an incident record in the external source.
Hinweis:  
If multiple users update the same record at the same time, the value on the remote system is from the last update call executed.  
For Remote Table API information, refer to:

* [v_query -- Scoped, Global](https://www.servicenow.com/docs/access?context=v_queryAPI&version=australia&pubname=australia-api-reference&ft:locale=en-US)
* [v_record - Scoped, Global](https://www.servicenow.com/docs/access?context=v_recordAPI&version=australia&pubname=australia-api-reference&ft:locale=en-US)
* [v_table -- Scoped, Global](https://www.servicenow.com/docs/access?context=v_tableAPI&version=australia&pubname=australia-api-reference&ft:locale=en-US)
{#remote-table-script-def-example4__vtable-api-xbl-list}

v_changed_fields is a map of changed field names and values.

    (function executeUpdate(v_record, v_changed_fields) {

    	var gr = new GlideRecord('incident');
    	if (gr.get(v_changed_fields.sys_id)) {
    		Object.keys(v_changed_fields).map(function(k) {
    				switch (k){
    				case "u_number" :
    					gr.number = v_changed_fields.u_number;
    					break;
    				case "u_short_description" :
    					gr.short_description = v_changed_fields.u_short_description;
    					break;
    			}
    		});
    	gr.update();
    } else {
    	v_record.setLastErrorMessage("Missing record to update, " + v_changed_fields.sys_id);
    }

    })(v_record, v_changed_fields);


