# 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***](https://docs.redivis.com/api/client-libraries/redivis-r/reference/dataset)***, 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***](https://docs.redivis.com/api/client-libraries/redivis-r/reference/workflow)***, 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](https://docs.redivis.com/api/client-libraries/redivis-r/reference/table) instance.

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

**self (a** [**Datasource**](https://docs.redivis.com/api/client-libraries/redivis-r/reference/datasource)**)**
