Rename Fields — Gives fields new names; the rest are kept — renames an item's fields: Customer Email from a spreadsheet becomes email, cust_no becomes customer_number. Every field you do not name is kept as it is. Use it when the next app expects names other than the ones you have.
Who can do this
Workspace Admins and Editors, on every plan.
Steps
- Select + where the fields should be renamed. In the step picker, open Data and select Rename Fields.
- Under Rename, select Add a field for each field to rename. A row each: the field's name now, and its new name — type
Customer Emailon the left andemailon the right. The names must match exactly, capitals included. - Optional: to rename many fields at once, type a regular expression in Rename with a pattern — a regular expression run over every field name after the rows — and what to put in its place in Replace the pattern with. Empty removes what matched. The pattern
^cf_with nothing in its place turnscf_regionintoregion; withcustom_, it givescustom_region. - Select Run this step, then check Output.
Output
The same items, with the fields renamed. The values do not change, the order of the fields is kept, and so are any files the item carries.
Good to know
- The rows run first, then the pattern — the pattern sees the new names the rows gave.
- A field the item does not have is skipped, not an error, so items with different fields can go through the same step. A row with no new name does nothing.
- Only the item's own fields are renamed, not the fields inside them. To reach inside a field, use Set / Edit Fields.
- If two fields end up with the same name, the item keeps only one of them — the one further along the item — and the step does not say so. Check Output after a test.
- The pattern is case-sensitive and can use
$1,$2in Replace the pattern with for the parts of the pattern in brackets:^(.*)_id$with$1Idturnsorder_idintoorderId. - A field whose name has a colon cannot be named in a row; use a pattern for it instead.
- To change values as well as names, use Set / Edit Fields.
- It runs once per item.
If something goes wrong
| What the run says | Why | What to do |
|---|---|---|
| Pattern is not one this step can read: … | The regular expression in Rename with a pattern has a mistake. | Correct it, then select Run this step again. |
| The pattern took longer than 100 ms on a field name. Make it simpler. | The pattern is too complex for the names it is run on. | Write a simpler pattern, or rename those fields in rows. |
| Renaming … would leave it with no name. | The pattern matched the whole of a field's name, and Replace the pattern with is empty. | Anchor the pattern to the part to remove, such as ^cf_, or give a replacement. |