Skip to main content

Updating Records


When updating a record, it’s important to understand how the provided values affect the data:

  1. Fields set to null:

    Behavior: If a field is set to null, the existing value for that field will remain unchanged.
    Example: If a donor's current suffix is שליטא, and the request sets the suffixHebrew field to null, the suffix will not be removed or updated; it will stay as שליטא.

  2. Fields set to an empty string or empty array:

    Behavior: If a field is set to an empty string or an empty array, the existing value will be deleted.
    Example: If the title is set to Mr. and a request is made with the title set to an empty string, the title will now be an empty field.

  3. All other provided fields:

    Behavior: Any other field that is provided with a value will update the existing value for that field.
    Example: If the current firstName is Dovid and the request provides a new value like Avi, the name will be updated to Avi.

  4. Handling Arrays of Objects:

    Behavior: Fields within arrays (such as lists of phones, emails, or addresses) will be updated based on a unique identifier for each object in the array, like phoneLabel, addressLabel, or emailLabel.
    Example: Phone objects will be updated based on the label provided in the request. If a label is missing from the request, the corresponding object will be deleted. If one out of five phone numbers on record needs to be deleted, the update request needs to contain the four phone objects that should be kept, the fifth being empty and therefore, deleted.

    note

    If the label is not present in the update, the entire corresponding object will be removed from the record.