• Home
  • Guides
  • Reference
  • Support

    Show / Hide Table of Contents
    • API Overview
      • Overview
      • Authentication
      • Retrieving API Results
      • Referenced vs Inline Entities
      • Choosing API Response Data
      • Handling API Errors
    • separator
    • Vehicle Routing Endpoints
      • Path
    • Optimization Endpoints
      • Instantiate
      • Build
      • Assignment Restrictions
      • Optimize
      • Sequence
      • Evaluate
      • Recommend
      • Insert
      • Centroids
      • Zones
      • Consolidate By Job Restrictions
      • Consolidate By Route Assignments
    • Geocoding Endpoints
      • Geocode
      • Reverse Geocode
    • Task Endpoints
      • List
      • Status
      • Result
      • Cancel
    • Sandbox Endpoints
      • List
      • Create
      • Rename
      • Retrieve
      • Update
      • Delete
      • Revisions
      • Add Revision
      • Expiry
      • Permissions
    • Verizon Connect Fleet Integration Endpoints
      • Pull Platform Data
      • Sync Platform Data
      • List Platform Territories
    • Other Endpoints
      • Canonicalize
      • Route Cards
      • Validate
      • Version
    • separator
    • Request Types
      • problem
      • capacity_metric
      • depot
      • driver
      • driver_break
      • job
      • job_template
      • job_type
      • load_amount
      • marker
      • problem_defaults
      • route
      • schedule
      • settings
      • shift
      • shift_override
      • shift_pattern
      • shift_pattern_assignment
      • stop
      • vehicle
      • zone
      • variance
    • Response Types
      • instantiate_response
      • problem_response
      • problem_aggregates
      • driver_response
      • geocoded_location
      • recommend_option
      • route_response
      • schedule_response
      • schedule_instantiate_response
      • stop_response
      • violation
    • Meta Types
      • task_redirect_response
      • task_status_response
      • validate_response
    • Sandbox Types
      • delta
      • array_delta
      • dict_delta
      • keyed_array_delta
      • object_delta
      • set_delta
      • revision
      • revision_created_response
      • revision_response
      • sandbox_response
    • Common Types
      • date_range
      • day_of_week
      • hazmat_load_type
      • id
      • latlon
      • stop_type
      • time_window
      • custom
      • polygon
    • Primitive Types
      • boolean
      • date
      • datetime
      • float
      • integer
      • string
      • timespan

    set_delta

    A set_delta is a type of delta that adds and removes strings from a string array that contains unique values and for which order does not matter. A set_delta can be used on the route.route_attributes or job.allowed_days_of_week fields, for example. If both are specified, the remove is performed before the add.

    Name Type Description
    $collection string Required. Must be "set" for a set_delta.
    $default string[] Optional. Defaults to []. If the delta is attempting to modify a non-existent array, create it first, using this value as the template.
    $path string Required on top-level deltas. The JSON path to modify. See Paths for a list of valid paths.
    add string[] Optional. Add strings to the existing array.
    remove string[] Optional. Remove strings from the existing array.

    Examples

    Example of a revision using a set_delta to modify route.route_attributes:

    {
      "deltas": [{
        "$path": ["route"],
        "$collection": "keyed_array",
        "ids": ["route0", "route1"],
        "assign": {
          "route_attributes": {
            "$collection": "set",
            "add": ["refrigeration"],
            "remove": ["licenced"],
          },
        },
      }]
    }
    

    The $default field can be used to make bulk edits to job.allowed_days_of_week work consistently, regardless of the existing field value.

    Example of a revision using a set_delta with a $default value:

    {
      "deltas": [{
        "$path": ["jobs"],
        "$collection": "keyed_array",
        "ids": ["job0", "job1", "job2"],
        "assign_template": {
          "allowed_days_of_week": {
            "$collection": "set",
            // use $default to ensure consistent behaviour if job.allowed_days_of_week is null or undefined
            "$default": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"],
            "remove": ["mon"]
          },
        }
      }]
    }
    

    See Also

    • delta.
    • Sandboxes.