# Edit your data and undo changes

Change your data by asking or by hand in the editor, and go back to any kept version: every change is saved as a new one.

Video: Edit your data and undo changes (1 min 15 s): /images/docs/videos/edit-your-data.mp4

- **Who can use it:** Free, Creator and Creator Max
- **You provide:** A dataset, and the change you want
- **You get:** The same dataset with the change, saved as a new version you can go back from

A dataset is yours to change: tidy values before a map goes out, tag the records a job touches, remove rows that do not belong, move a point that was placed in the wrong town, draw a zone that exists in no dataset, undo an edit, see what a colleague changed, go back to how the data was before an import. There are two ways:

- **Ask.** Most editing can be done by asking: set a value for the rows that match a rule, add or remove a column, delete rows, turn a column into dates, fix a dataset that shows in the wrong place.
- **Edit by hand** in the dataset editor. Some things need it, and some are simply quicker there: when you can see where a point belongs, dragging it beats describing it.

Either way the change is saved as a new **version**. When you go back, Mapstack copies the earlier version forward as the newest one. The asks on this page are examples of the kind of thing to say.

## Change values and rows by asking

Name the dataset (the one open beside the conversation, one in the session, or one in your Library), which rows (a rule, the rows you selected, or every row) and the change.

**A clear request is carried out without a question,** because any version can be brought back.

**It stops and asks before a big change.** If an edit would delete or overwrite every row, or more than half the rows of a dataset of 50 rows or more, Mapstack shows how many (as a count and a share) and waits for you. It also asks when your request could be read more than one way, or could mean more than one dataset.

**It reports exactly what it did:** to how many rows out of how many, the rule in plain words, and anything it assumed. If you said "sent" and the column says SHIPPED, it tells you it matched them.

**If no row matches, nothing changes.** Mapstack shows the closest values the column does hold, so you can ask again with the right one.

**Several changes in one message** are made in order. If a later one stops for a question, the earlier ones may already be saved; the reply says which.

**On a routine, with nobody there,** Mapstack makes small changes as usual but will not delete rows, remove a column, or change all or most rows. Those wait for a person.

### Change values for the rows that match a rule

Say which dataset, which rows and the new value. A rule compares a column with a value; several conditions can be combined.

> Set status to sold for the bakeries

> Change London to Greater London in the city column

> Replace the blanks in the region column with Unknown

### Change the rows you pick on the map

For rows a rule cannot describe (these six, the ones in this corner), select them first: open the dataset, choose **Select**, and click them or draw round them. What you select goes with your next message.

> Set the status of the selected rows to inspected

### Delete rows

> Delete the rows where condition is secondhand

## Columns and dates

**Dates are converted only when every value fits.** When some values do not fit one way of reading dates, Mapstack shows how many and up to 5 examples: fix those, then ask again.

**Working values out is analysis.** A new figure from other columns or other datasets comes from asking a question of your data, and is kept as a new dataset: see [Ask questions about your data](/docs/answers/ask-about-your-data).

### Add, remove or clean up columns

To turn a column of text or numbers into dates, say whether the day or the month comes first.

> Add a column called category and set it to active

> Remove the notes column

> Turn the opened column into dates, day first

## A dataset in the wrong place

### Fix a dataset that shows in the wrong place

If the coordinates are in another system, the records land somewhere strange. Name the system and Mapstack converts them to latitude and longitude.

> My points are showing in the sea off Africa. They are in British National Grid.

## Move, draw and reshape by hand

**Ask first.** Most editing can be done by asking. Where a change needs the editor, Mapstack says so and gives you the steps. Changing a latitude or longitude column does not move a record on the map. The dataset editor is for records one at a time or a few together, and for their shapes.

**Move a point.**

1. Open the dataset and stay on its **Map** tab.
2. Select the point and choose **Edit feature**, or select **Edit** in the top bar.
3. Choose **Move** and drag the point to where it belongs.
4. Select **Save**.

**Draw, reshape and tidy.** On the **Map** tab the same editor has **Add feature** (a point, line or area, with a form for its values), **Edit vertices**, **Reshape**, **Split**, **Merge**, **Copy**, **Paste** and **Delete**, with **Snapping** to other records or to the basemap's buildings, roads and rivers, and a **Grid** to draw against. Press ? for the keyboard shortcuts, including typing an exact distance, angle or coordinates. On the **Table** tab, change a value in its cell, or tick several rows and use **Edit together**.

![Example: the City of Melbourne's survey of Carlton's 4,368 street and park trees, open for editing. One Osage Orange in Argyle Square is selected, its values in the form beside the map, ready to change, move or delete.](/images/docs/edit-your-data/tree-selected-in-edit-mode.jpeg)

**Undo** and **Redo** step through your changes before you save. **Cancel** throws them away. Until you save, your edits are kept only in this browser.

## Versions: undo, history and going back

**Restoring creates a new version.** Mapstack copies the version you choose, and the one you left stays in the list, so you can go forward as well as back.

**Go back by hand.**

1. Open the dataset.
2. Select **Version** in the top bar. It shows the current version's number.
3. Select a version. Each shows its number, when it was saved and what that change did. The live one is marked **Current**.
4. Select **Restore** to confirm.

The restore is saved as a new version, and you are told its number. While you are editing, restore waits until you **Save** or **Cancel**.

**Maps follow the dataset; reports do not.** A map made from the dataset shows whichever version is current, so a change or a restore appears there. A report keeps the copy of the data it was made from.

**Old versions are pruned.** The most recent are kept, and a version is never removed straight after it is replaced; how many, and for how long, is in [Sizes and limits](/docs/workspace/sizes-and-limits). To keep a dataset exactly as it is now for longer, download a copy: see [Download and export](/docs/share/download-and-export).

### Undo the last change

> Undo that

### See what changed

Mapstack lists the versions, newest first: each one's number, when it was saved, how many rows it has, what it changed, and, for a restore, which version it brought back.

> What changed in the customers dataset?

### Go back to a particular version

Describe the version by what came before or after it. Say which dataset if more than one could be meant.

> Go back to the version of the stores dataset from before the import

## Reference

**What a rule can say**

| | |
|---|---|
| Comparisons | is, is not, more than, less than, at least, at most, contains, is empty |
| Combining conditions | all of them, or any of them |
| Conditions in one rule | Up to 8 |
| New column types | text, number, true or false, date |

**Editing by hand**

| | |
|---|---|
| Records merged at once | Up to 200 |
| Units | Metric or US Standard, in the editor's **Settings** |

**Versions**

| | |
|---|---|
| What makes a version | Every edit, every restore, and every change to the dataset's details |
| The current version | Always kept |

How many records the editor opens and how many versions are kept: see [Sizes and limits](/docs/workspace/sizes-and-limits).

## What it can't do

**By asking**, Mapstack will not:

- Remove the geometry or the row id.
- Set a value that does not fit the column's type.
- Turn a column into dates when its values do not all fit one way of reading dates.

**Either way:**

- Change or roll back a report made from the dataset. A report keeps its own copy of the data.
- Edit imagery, scenes, reports or prints by hand.
- Edit or restore on a public page, or as a Viewer.
- Go back past the versions kept.

## Common questions

**Does editing a dataset change my original file?**

No. The dataset is a separate thing made from your file.

**Does a restore delete the newer versions?**

The version you were using just before the restore stays in the list. Restore it to go forward again. Older versions are still subject to the [version history limits](/docs/workspace/sizes-and-limits).

**Does going back change my maps and reports?**

Maps made from the dataset show whichever version is current, so they follow. A report keeps the copy of the data it was made from, and stays as it was.

**Can I draw a new area from scratch?**

Yes. Open the dataset, select **Edit**, then **Add feature**, and draw it. Mapstack can then measure it for you.

**Are my edits kept if I close the page before saving?**

Open the dataset again in the same browser, and you are offered your unsaved edits back. Until you save, they are kept only in that browser.

**What if the dataset is saved somewhere else while I am editing?**

A routine, another conversation or a colleague can save a new version while your edits are open. Your edits stay as they are, and a notice names the newer version. **Save** applies your edits on top of it: where you both changed the same value, yours is kept, and a change to a row the newer version deleted is skipped. **Cancel** throws your edits away and shows the newer version.

When you are not editing, an open dataset moves to a version saved elsewhere by itself, within about half a minute, or as soon as you come back to the tab.

## Related

- [Map a spreadsheet: addresses, coordinates or place names](https://mapstack.io/docs/your-data/spreadsheets.md)
- [Get a dataset](https://mapstack.io/docs/make/datasets.md)
- [Ask questions about your data](https://mapstack.io/docs/answers/ask-about-your-data.md)
- [Download and export](https://mapstack.io/docs/share/download-and-export.md)
- [What a routine can and can't do](https://mapstack.io/docs/automate/what-a-routine-can-do.md)
- [Find your work in the Library](https://mapstack.io/docs/organise/the-library.md)
- [Turn a shapefile into a web map](https://mapstack.io/docs/guides/shapefile-to-a-web-map.md)
- [Clean up a messy file and hand it back in a format another GIS can open](https://mapstack.io/docs/guides/clean-up-a-file.md)
- [Keep a register of your assets on a map, tag them by area and pull out what someone needs](https://mapstack.io/docs/guides/asset-register.md)
- [Build a prospect list of every business of one kind in an area](https://mapstack.io/docs/guides/build-a-prospect-list.md)
- [Make a black-and-white figure-ground drawing of the buildings around a site](https://mapstack.io/docs/guides/figure-ground-base-map.md)
