# Datasource$update

### Datasource$<mark style="color:purple;">update</mark>(*source\_dataset, source\_workflow, sample, version, mapped\_tables*) → self

Update a datasource to reference a different source workflow, source dataset, or sample / version thereof.

Note that `mapped_tables` is a required argument if the referenced tables in the old datasource cannot be automatically mapped to the new datasource (e.g., deleted tables across versions or different table naming conventions across datasets / workflows).

### **Parameters:**

**`source_dataset` :&#x20;*****str |*** [***Dataset***](/api/client-libraries/redivis-r/reference/dataset.md)***, default None*** \
Update the datasource to reference a given dataset (and corresponding version / sample status). Can either be a fully qualified reference as a string, or a Dataset instance.&#x20;

**`source_workflow` :&#x20;*****str |*** [***Workflow***](/api/client-libraries/redivis-r/reference/workflow.md)***, default None*** \
Update the datasource to reference a given workflow. Can either be a fully qualified reference as a string, or a Workflow instance.&#x20;

**`sample` :&#x20;*****bool, default None***\
If specified, update the sampling status of the datasource. Only relevant to datasources that reference a dataset.

**`sample` :&#x20;*****str, default None***\
If specified, update the version of the datasource. Only relevant to datasources that reference a dataset.

**`mapped_tables` :&#x20;*****list(prev=next, ...) | list(list(prev, next), ...)***\
Required if referenced tables in the old datasource cannot be automatically mapped to the new datasource (e.g., deleted tables across versions or different table naming conventions across datasets / workflows). Can either be

1. A named list of table names, with keys as the previous table name and values as the new table name; or&#x20;
2. An unnamed list of lists, where each inner list has two entries, representing the previous table and next table, respectively. Each list entry can either be a table name or a [Table](/api/client-libraries/redivis-r/reference/table.md) instance.

### **Returns:**&#x20;

**self (a** [**Datasource**](/api/client-libraries/redivis-r/reference/datasource.md)**)**


---

# 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.redivis.com/api/client-libraries/redivis-r/reference/datasource/datasourceusdupdate.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.
