Skip to content

=JSONUPDATE

The =JSONUPDATE() function adds a new property to a JSON object or updates the value of an existing property. If the specified property already exists, its value is replaced. If it does not exist, the property is added to the JSON object.

=JSONUPDATE(ExistingJsonObject; PropertyName; PropertyValue)
  • ExistingJsonObject: The JSON object to modify

  • PropertyName: The name of the property to add or update (as text)

  • PropertyValue: The new value to assign to the property

The function evaluates the provided JSON object and looks for the specified property name. If the property is found, its value is updated with the new value. If the property is not found, it is added to the object. The function returns a new JSON object reflecting the change.

  • The original JSON object is not modified; a new object is returned.

  • Property names are case sensitive and must match exactly.

  • The property value can be text, a number, a boolean, or a JSON object or array.

  • If the property already exists, its previous value is fully replaced.

  • Formula functions are case sensitive and must be written in ALL CAPS.


// Original customer object
Customer = {
"name": "John Smith",
"email": "[email protected]",
"status": "inactive",
"lastLogin": "2025-01-15"
}
// Update the status from "inactive" to "active"
=JSONUPDATE(Customer; status; active)

Result:

{
"name": "John Smith",
"email": "[email protected]",
"status": "active",
"lastLogin": "2025-01-15"
}
// Add a new "phone" property to the customer
=JSONUPDATE(Customer; phone; 555-123-4567)

Result:

{
"name": "John Smith",
"email": "[email protected]",
"status": "active",
"lastLogin": "2025-01-15",
"phone": "555-123-4567"
}

JSONUPDATE, JSON, update JSON, modify JSON object, add JSON property, update JSON property, formula function, case sensitive functions