# Updates

To write data back to a data service using a data source object, use the `write` method on the data source.&#x20;

To check for service provider support for writing data, use the `allow.write` attribute on the [DataSource](/wirebootstrap/reference/wire.data/wire.data.datasource.md) object servicing the query request.  Visit the data source service provider documentation for details on support for writing data.

## Writing Data

The following sends two users to the data service to be persisted in the `Users` table in a relational database using the [WireBootstrap Query Service](https://docs.wirebootstrap.com/query-service) as identified by the `table` parameter in the data source constructor.  An option specifies the key on the entity.  Options are provider specific.  This option is used by the query service to determine whether to insert or update each record.  &#x20;

```javascript
const accountService = new wire.data.DataSource("sql", {
    Provider: {
        Server: "query-server"
    }
});

const users = [
    {UserName: "jkratz", Active: true},
    {UserName: "pdougherty", Active: false},
]
 
const options = {
    Keys: ["name"]
}

const newrows = accountService.write("Users", users, options);
```

Visit [WireBootstrap Query Service](https://docs.wirebootstrap.com/query-service) for more on the query service.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/wirebootstrap/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
