Works on this device
Conversion Mapping Worksheet
Plan a data conversion one field at a time. Each row maps a source field to a target field, with the type of each, a conversion rule, a status and a note. The worksheet checks the mapping for fields that are left out, used twice or changed to a type that can lose data, and writes it as CSV, JSON and a Markdown table. Everything stays in your browser.
Your mapping
Check these values
This is off unless you turn it on. Saved entries stay in this browser only. Untick the box to delete them.
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Mapping check
How it was worked out
How to use this worksheet
- To start from your data, choose Read the fields of two layouts and match them by name. Paste a JSON sample, the header row of a CSV file or a list of field names for the source and for the target.
- Choose Read the fields, then Use these fields as mapping rows. The fields move into the worksheet, matched by name where the names agree.
- In each row, check the two fields and their types, write the conversion rule, and set the status: To do, Mapped, Checked or Not needed.
- Choose Check the mapping. The result shows what each row needs, and the mapping as CSV, JSON and a Markdown table that you can copy or download.
- Tick Save my entries on this device to keep the rows in this browser, or download them as a file and open the file again later.
What the worksheet checks
- A source field with no target. The value is not carried over. Set the status to Not needed when that is what you want.
- A target field with no source and no rule. Say in the rule where the value comes from, for example a fixed value or a value worked out from other fields.
- A name used twice. One source in several rows can be right. Two rows that write the same target are almost always a mistake. Names are compared exactly.
- A type change that can lose data. The list of cases is in the table below.
Type changes that can lose data
The check uses this fixed list. A change that is not in the list is shown as OK. The list is a help for planning and does not cover every system.
| From | To | What can be lost |
|---|---|---|
| Decimal number | Whole number | The part after the decimal point is lost or rounded. |
| Text | Whole number or decimal number | Text that is not a number cannot be converted. |
| Text | True or false | Text that is not one of the agreed words for true and false cannot be converted. |
| Text | Date, or date and time | Text that is not in the expected date form cannot be converted. |
| Date and time | Date | The time of day and the time zone are lost. |
| Whole number or decimal number | True or false | Every number other than zero becomes true, so the number is lost. |
| Whole number | Decimal number | A whole number above 9,007,199,254,740,992 loses digits in a 64-bit decimal number. |
| List of values, or object | Whole number, decimal number, true or false, date, or date and time | A value with several parts does not fit one value. |
| Binary data | Text | Bytes that are not text are lost unless they are encoded, for example as Base64. |
Worked example
Choose Try an example in the worksheet. It has 7 rows. Four rows have a source and a target. The row signup_date to signupDate changes a date and time to a date, and the row balance to balanceCents changes a decimal number to a whole number: the worksheet marks 2 type changes that can lose data. The source address.zip has no target and its status is To do, so it is counted as 1 source field with no target. The source tags has the status Not needed, so it is not counted. The target importedBy has no source, but its rule says that it is a fixed value, so it is not counted either.
In the other choice, the example source is a JSON object with 9 fields and the example target is CSV with 7 columns. Five fields are matched by name: user_id and userId are the same name when capitals and underscores are ignored.
Limits you should know
- The worksheet checks names and types only. It does not read, convert or test your data. Test the conversion with real records before you rely on it.
- From a JSON sample only the first object is read. A number written as
1.0is read as a whole number, and an empty value has no type. From CSV the types are a guess from the second row. - A match by name is a guess. Two fields with the same name can still mean different things.
- A worksheet can hold up to 400 rows, and a layout up to 200 fields. A field name can have up to 120 characters.
- In the CSV text, a cell is written as you typed it. A spreadsheet program may read a cell that starts with
=,+,-or@as a formula. - Your text is read in this browser and is not uploaded. Saved entries stay on this device and are lost when the browser data is cleared.