---
title: "Edit Field"
method: PATCH
path: "/v3.0/fields/{slug}/"
tags: ["fields"]
---

# Edit Field

`PATCH /v3.0/fields/{slug}/`

## Request

- Base URL: `https://api.formaloo.me`
- URL: `https://api.formaloo.me/v3.0/fields/{slug}/`
- Auth: none declared. Required headers: `x-api-key`

# Linked row field

## Auto-creating lookup fields

When updating the linked row field, you can send a list of slugs of the fields (`create_lookup_for_fields`), so a new lookup field is created for each.
The newly created lookup fields will be connected to the specified fields, the current linked row field, and also copy all their data from the current field.
The list of fields sent on `create_lookup_for_fields` should contain the slug of the fields with these specification:

- They should be on the related form of the current field.
- They should be fields that support a linked row connected for them. So, not readonly fields (e.g. meta or success page), no complex fields (e.g. matrix or table).

Whatever field you send on `create_lookup_for_fields`, a new lookup field will be created for it. Even if the list contains repetitive items or a lookup field with for the given field already exists.

List of the newly created fields will be sent back on `new_lookup_fields` field. These fields are automatically added to the form, right after the current field. So always get the new data of the form from the server after creating new fields using this method.

Request Example

``` json
{
   "create_lookup_for_fields": [
       "IXVsW05e",
       "Y2BUblWG"
   ]
}
```

Response Example
``` json
{
    "status": 200,
    "errors": {
        "general_errors": [],
        "form_errors": {}
    },
    "data": {
        "field": {
            "type": "linked_rows",
            "related_form": {
                "slug": "YdUTckS0",
                "address": "bfq2f",
                "title": "NPS New Test 25",
                "category": null,
                "show_submit_tracking_code": false,
                "assign_submit_number": false,
                "accept_draft_answers": false,
                "ai_mode": false,
                "full_form_address": "https://me.formaloo.xi/bfq2f",
                "version": "v1",
                "generate_pdf_for_user": false,
                "generate_pdf_for_admin": false
            },
            ...,
            "new_lookup_fields": [
                {
                    "slug": "ZwEpJU5E",
                    "created_at": "2024-10-04T12:55:42.227433Z",
                    "updated_at": "2024-10-04T12:55:42.227462Z",
                    "type": "lookup",
                    "title": "lined rows field",
                    "alias": null,
                    "description": null,
                    "answer_description": null,
                    "position": 0,
                    "required": false,
                    "unique": false,
                    "admin_only": false,
                    "read_only": false,
                    "json_key": null,
                    "is_calculatable": true,
                    "calculation_items": null,
                    "is_random_sortable": true
                },
                {
                    "slug": "rso2FKLn",
                    "created_at": "2024-10-04T12:55:42.241882Z",
                    "updated_at": "2024-10-04T12:55:42.241911Z",
                    "type": "lookup",
                    "title": "lined rows field",
                    "alias": null,
                    "description": null,
                    "answer_description": null,
                    "position": 0,
                    "required": false,
                    "unique": false,
                    "admin_only": false,
                    "read_only": false,
                    "json_key": null,
                    "is_calculatable": true,
                    "calculation_items": null,
                    "is_random_sortable": true
                }
            ],
            "default": null
        }
    }
}
```

## Path parameters

- `slug` string, required

## Headers

- `x-api-key` string, required
- `x-workspace` string

## Request body

- PatchedFieldActionRequest
  - `title` string, nullable: field title or label to be shown to user. (e.g. "your contact email")
  - `alias` string, nullable: a user-defined slug to identify the field, which is unique form-wide, unless null.
  - `description` string, nullable: extra info on the field (if any). (e.g. "please use the email account you always check.")
  - `answer_description` string, nullable: any description on this question and it's answers.
  - `position` integer: the order of the field on the form. (e.g. 2)
  - `required` boolean: is the field required?
  - `unique` boolean: should the submitted value be unique for the form?
  - `availability_limit_per_answer` integer: the maximum number of times an answer can be submitted.
  - `admin_only` boolean: if set true, it will be set as admin only, and end users won't be able to see/submit it.
  - `read_only` boolean: if set true, it will be set as read only, and end users won't be able to submit it.
  - `json_key` string, nullable: A string to represent the field value in a json output.
  - `is_random_sortable` boolean: if value is True, can randomly sort this field
  - `acceptable_answers` object, nullable: set if the field only accepts answers from a predefined list (e.g. a list of emails for a email field).
  - `unacceptable_answers` object, nullable: set if the field won't accepts answers from a specific list (e.g. a list of emails for a email field).
  - `default` string, nullable: default value for this field. should be valid for the field (e.g. a number for number fields, or a valid choice for choice fields).

## Response `200`

- FieldAction
  - `slug` string, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `type` 'generic_field' | 'short_text' | 'long_text' | 'regex' | 'yes_no' | 'checkbox' | 'choice' | 'dropdown' | 'multiple_select' | 'choice_fetch' | 'table' | 'repeating_section' | 'matrix' | 'website' | 'email' | 'phone' | 'email_verification' | 'meta' | 'oembed' | 'success_page' | 'file' | 'signature' | 'hidden' | 'city' | 'country' | 'number' | 'product' | 'rating' | 'lookup' | 'linked_rows' | 'time' | 'date' | 'user' | 'profile' | 'profile_data' | 'assignee' | 'variable'
  - `title` string, nullable: field title or label to be shown to user. (e.g. "your contact email")
  - `alias` string, nullable: a user-defined slug to identify the field, which is unique form-wide, unless null.
  - `description` string, nullable: extra info on the field (if any). (e.g. "please use the email account you always check.")
  - `answer_description` string, nullable: any description on this question and it's answers.
  - `position` integer: the order of the field on the form. (e.g. 2)
  - `required` boolean: is the field required?
  - `unique` boolean: should the submitted value be unique for the form?
  - `availability_limit_per_answer` integer: the maximum number of times an answer can be submitted.
  - `admin_only` boolean: if set true, it will be set as admin only, and end users won't be able to see/submit it.
  - `read_only` boolean: if set true, it will be set as read only, and end users won't be able to submit it.
  - `json_key` string, nullable: A string to represent the field value in a json output.
  - `is_random_sortable` boolean: if value is True, can randomly sort this field
  - `acceptable_answers` object, nullable: set if the field only accepts answers from a predefined list (e.g. a list of emails for a email field).
  - `unacceptable_answers` object, nullable: set if the field won't accepts answers from a specific list (e.g. a list of emails for a email field).
  - `default` string, nullable: default value for this field. should be valid for the field (e.g. a number for number fields, or a valid choice for choice fields).

---

[API](https://skmtc.dev/formaloo/apis/formaloo-api-documentation.md) · [All operations](https://skmtc.dev/formaloo/apis/formaloo-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/formaloo/apis/formaloo-api-documentation/revisions/47b268aeb656?raw)
