You're viewing a demo portfolio

Join the waitlist
PRSM

create_field

Active

Tool of QuintaDB

declared in 1.0.0

Додати поле до форми. Для повного переліку типів та їхніх параметрів — виклич get_field_types спочатку. Базові типи: text, textarea, integer, float, date, datetime, email, phone, url, select, checkbox, radio, file, image, location, autoincrement, yes_no, rel, formula, linked_column, linked_records, action, divider, page_break, note, signature, country, language, states, time_zone, record_owners, matrix.

Parameters schema

{
  "type": "object",
  "required": [
    "app_id",
    "entity_id",
    "name",
    "field_type"
  ],
  "properties": {
    "ampm": {
      "type": "boolean",
      "description": "true — 12-годинний формат (AM/PM) для time/datetime"
    },
    "desc": {
      "type": "string",
      "description": "Підказка-tooltip для заповнювача форми"
    },
    "func": {
      "type": "integer",
      "description": "Функція для formula_type=function: 0=MIN, 1=MAX, 2=ROUND_UP, 3=ROUND_DOWN, 4=Ruby script"
    },
    "icon": {
      "type": "string",
      "description": "action field: FontAwesome клас іконки"
    },
    "name": {
      "type": "string",
      "description": "Назва поля"
    },
    "rich": {
      "type": "boolean",
      "description": "true — текстовий редактор (для field_type=textarea)"
    },
    "step": {
      "type": "integer",
      "description": "Крок autoincrement (default 1)"
    },
    "field": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Масив ID полів або константи ['Constant', 'текст'] для formula_type=formula"
    },
    "app_id": {
      "type": "string",
      "description": "ID проєкту"
    },
    "choices": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Варіанти вибору (для select/checkbox/radio)"
    },
    "default": {
      "type": "string",
      "description": "Значення за замовчуванням (для select — один з варіантів choices)"
    },
    "visible": {
      "type": "boolean",
      "description": "false — поле приховане у таблиці (але залишається у формі)"
    },
    "rel_type": {
      "type": "integer",
      "description": "Тип зв'язку: 2=belongs_to dropdown (default), 6=belongs_to radio, 8=belongs_to multi, 3=has_one dropdown, 5=has_one radio, 9=has_one multi, 1=many-to-many autocomplete, 4=many-to-many checkboxes"
    },
    "required": {
      "type": "boolean",
      "description": "true — поле обов'язкове для заповнення"
    },
    "delimiter": {
      "type": "string",
      "description": "Роздільник тисяч: '' або ',' або '.'"
    },
    "dependent": {
      "type": "boolean",
      "description": "true — це залежне rel поле (фільтрується батьківським). Обов'язково разом з depends_from_field_id."
    },
    "entity_id": {
      "type": "string",
      "description": "ID форми"
    },
    "operation": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Оператори між полями: +, -, *, / (на 1 менше ніж кількість полів)"
    },
    "precision": {
      "type": "integer",
      "description": "Знаків після коми для float (default 2)"
    },
    "separator": {
      "type": "string",
      "description": "Роздільник дробової частини: '.' або ','"
    },
    "field_type": {
      "type": "string",
      "description": "Тип поля. Виклич get_field_types для повного переліку з описами."
    },
    "operand_is": {
      "type": "string",
      "description": "Тип операндів для formula_type=formula: numbers, decimal, text, days, hours, year. ОБОВ'ЯЗКОВО якщо formula_type=formula."
    },
    "start_from": {
      "type": "integer",
      "description": "Початкове значення autoincrement (default 1)"
    },
    "text_align": {
      "type": "integer",
      "description": "Вирівнювання в комірці: 1=ліво, 2=право, 3=центр, 4=ширина"
    },
    "uniqueness": {
      "type": "object",
      "properties": {
        "uniq_type": {
          "type": "integer",
          "description": "0=немає, 1=строга унікальність, 2=multi (комбінація полів)"
        },
        "error_message": {
          "type": "string",
          "description": "Кастомне повідомлення при порушенні унікальності"
        },
        "linked_fields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Для uniq_type=2: масив назв або ID інших полів"
        }
      },
      "description": "Перевірка унікальності значень у полі."
    },
    "action_fill": {
      "type": "integer",
      "description": "action field: 0=inline(default), 1=block"
    },
    "action_size": {
      "type": "integer",
      "description": "action field: 0=small,1=medium(default),2=large"
    },
    "action_type": {
      "type": "integer",
      "description": "action field: 0=link(default), 1=button"
    },
    "entries_num": {
      "type": "integer",
      "description": "Кількість пов'язаних записів для linked_records (default 5)"
    },
    "func_fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID усіх полів що використовуються у func/script_body. ОБОВ'ЯЗКОВО для formula_type=function — без цього формула не перераховується."
    },
    "is_currency": {
      "type": "boolean",
      "description": "Показувати як валюту"
    },
    "matrix_rows": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Рядки матриці (field_type=matrix)"
    },
    "script_body": {
      "type": "string",
      "description": "Ruby-код для func=4. Правила: результат у змінній 'a', остання строчка — 'a'; назви полів в одинарних лапках 'field_name'.to_f; заборонені def/while/puts/return/require; ЗАБОРОНЕНО агрегувати субформи через .to_f (для цього linked_column)."
    },
    "validations": {
      "type": "object",
      "properties": {
        "is": {
          "description": "Точна довжина (для text) або точне значення (для number)"
        },
        "URL": {
          "type": "string",
          "description": "\"on\" — перевірка формату URL"
        },
        "Email": {
          "type": "string",
          "description": "\"1\" — перевірка формату email"
        },
        "format": {
          "type": "string",
          "description": "Regexp у форматі /^regex$/ — перевірка за регулярним виразом"
        },
        "maximum": {
          "description": "Максимум: для text — кількість символів; для integer/float — числове значення"
        },
        "minimum": {
          "description": "Мінімум: для text — кількість символів; для integer/float — числове значення"
        },
        "LOCATION": {
          "type": "string",
          "description": "\"1\" — перевірка геолокації"
        },
        "Exclusion": {
          "type": "string",
          "description": "Заборонені значення через кому: \"spam, abuse\""
        },
        "Inclusion": {
          "type": "string",
          "description": "Дозволені значення через кому: \"Admin, Manager, User\""
        },
        "onlyOnSubmit": {
          "type": "string",
          "description": "\"1\" — валідувати тільки при сабміті, не на льоту"
        },
        "exclusion_allowNull": {
          "type": "string",
          "description": "\"on\" — дозволити пусте значення у Exclusion"
        },
        "inclusion_allowNull": {
          "type": "string",
          "description": "\"on\" — дозволити пусте значення у Inclusion"
        },
        "exclusion_partialMatch": {
          "type": "string",
          "description": "\"on\" — частковий збіг у Exclusion"
        },
        "inclusion_partialMatch": {
          "type": "string",
          "description": "\"on\" — частковий збіг у Inclusion"
        },
        "exclusion_caseSensitive": {
          "type": "string",
          "description": "\"on\" — враховувати регістр у Exclusion"
        },
        "inclusion_caseSensitive": {
          "type": "string",
          "description": "\"on\" — враховувати регістр у Inclusion"
        }
      },
      "description": "Правила валідації поля. required: true — простіший спосіб для обов'язкового поля."
    },
    "action_color": {
      "type": "integer",
      "description": "action field: 0=primary,2=success,3=danger,6=light(default)"
    },
    "action_tasks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "task_type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Унікальний ID задачі (для посилань з action_display_rules)"
          },
          "emails": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "numbers": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "webhook": {
            "type": "object",
            "description": "Конфіг вебхуку: {request_method(0-4), auth_type(0-2), url, webhook_params[], webhook_headers[]}"
          },
          "sms_body": {
            "type": "string"
          },
          "task_type": {
            "type": "integer",
            "description": "0=email, 1=sms, 2=update_record, 3=payment, 4=webhook, 5=open_form_or_url, 6=message(telegram/wa)"
          },
          "custom_url": {
            "type": "string"
          },
          "email_body": {
            "type": "string"
          },
          "sms_column": {
            "type": "string"
          },
          "email_column": {
            "type": "string"
          },
          "open_form_id": {
            "type": "string"
          },
          "update_fields": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Поля для оновлення (task_type=2). Кожен об'єкт: {field_id, val, set_current_time, set_current_user}"
          },
          "open_custom_url": {
            "type": "boolean"
          },
          "sms_template_id": {
            "type": "string"
          },
          "open_form_widget": {
            "type": "boolean"
          },
          "payment_workflow": {
            "type": "object",
            "description": "Конфіг оплати: {merchant_type(0=paypal,1=braintree), amount_field_id, business_email, currency, ...}"
          },
          "email_template_id": {
            "type": "string"
          },
          "sms_from_template": {
            "type": "boolean"
          },
          "number_from_record": {
            "type": "boolean"
          },
          "email_from_template": {
            "type": "boolean"
          },
          "redirect_to_new_page": {
            "type": "boolean"
          },
          "telegram_template_id": {
            "type": "string"
          },
          "whatsapp_template_id": {
            "type": "string"
          },
          "message_from_template": {
            "type": "boolean"
          },
          "email_recipient_source": {
            "type": "integer",
            "description": "0=список emails, 1=з поля, 2=власники запису"
          },
          "message_recipient_source": {
            "type": "integer"
          }
        }
      },
      "description": "Задачі поля Дія (field_type=action). task_type: 0=email, 1=sms, 2=update_record, 3=payment, 4=webhook, 5=open_form_or_url, 6=telegram/whatsapp. Виклич get_field_types для повної специфікації."
    },
    "default_type": {
      "type": "integer",
      "description": "Тип значення за замовчуванням: 0=фіксований, 1=поточна дата/час (для date/datetime), 2=поточний користувач (для record_owners)"
    },
    "disable_past": {
      "type": "boolean",
      "description": "Заборонити вибір минулих дат (для date/datetime/dob)"
    },
    "formula_type": {
      "type": "string",
      "description": "Тип формули: formula (арифметика/конкатенація), function (вбудовані функції + Ruby), link (clickable link), total (сума), average (середнє). ОБОВ'ЯЗКОВО для field_type=formula."
    },
    "currency_unit": {
      "type": "string",
      "description": "Символ валюти: '$', '€', '₴' тощо"
    },
    "rel_entity_id": {
      "type": "string",
      "description": "ID форми до якої лінкує rel поле (обов'язково для rel)"
    },
    "disable_future": {
      "type": "boolean",
      "description": "Заборонити вибір майбутніх дат (для date/datetime/dob)"
    },
    "matrix_columns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Колонки матриці (field_type=matrix)"
    },
    "vertical_align": {
      "type": "integer",
      "description": "Вертикальне вирівнювання: 1=зверху, 2=посередині, 3=знизу"
    },
    "formula_link_to": {
      "type": "string",
      "description": "formula_type=link: on_table або table_form"
    },
    "truncates_after": {
      "type": "integer",
      "description": "Обрізати текст у таблиці після N символів (default 1000)"
    },
    "display_as_image": {
      "type": "boolean",
      "description": "true — показувати URL як картинку в таблиці (тільки для field_type=url). Використовуй при створенні поля для фото."
    },
    "hide_column_name": {
      "type": "boolean",
      "description": "action/formula: сховати назву колонки в таблиці"
    },
    "linked_entity_id": {
      "type": "string",
      "description": "ID форми для linked_records / linked_column / linked_records_count"
    },
    "rel_show_field_id": {
      "type": "string",
      "description": "ID поля яке відображати в rel dropdown (опційно)"
    },
    "action_done_message": {
      "type": "string",
      "description": "action field: повідомлення після виконання задачі"
    },
    "formula_link_column": {
      "type": "string",
      "description": "formula_type=link: ID поля з назвою таблиці/форми"
    },
    "formula_link_target": {
      "type": "string",
      "description": "formula_type=link: _blank, _self, _parent, _top"
    },
    "action_display_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "action_task_ids"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "icon": {
            "type": "string",
            "description": "FontAwesome клас, напр. 'fas fa-check'"
          },
          "name": {
            "type": "string"
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Умови відображення (пусто = для всіх записів). {property_id, condition, search, join: and|or}"
          },
          "action_size": {
            "type": "integer",
            "description": "0=small,1=medium,2=large"
          },
          "action_type": {
            "type": "integer",
            "description": "0=link, 1=button"
          },
          "action_color": {
            "type": "integer",
            "description": "0=primary,1=secondary,2=success,3=danger,4=info,5=warning,6=light,7=dark"
          },
          "criteria_name": {
            "type": "string",
            "description": "Опис критеріїв (обов'язково)"
          },
          "action_task_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "ID задач з action_tasks"
          }
        }
      },
      "description": "Правила відображення кнопки Дія залежно від умов. Якщо дія для всіх записів — не передавай цей масив взагалі."
    },
    "add_percent_to_number": {
      "type": "boolean",
      "description": "Додавати знак % після числа"
    },
    "depends_from_field_id": {
      "type": "string",
      "description": "ID батьківського rel поля в тій самій формі (для каскаду Країна→Місто, Марка→Модель тощо)"
    },
    "add_to_actions_control": {
      "type": "boolean",
      "description": "action: додати до меню масових дій"
    },
    "linked_records_count_form_id": {
      "type": "string",
      "description": "ID форми для підрахунку (обов'язково для field_type=linked_records_count)"
    },
    "not_add_space_between_operands": {
      "type": "integer",
      "description": "1 = не додавати пробіл між операндами (для конкатенації без пробілів)"
    }
  }
}

What this tool wraps· 0 endpoints

min confidence0.700.50

No endpoints wrapped at confidence ≥ 0.70.

Parent server

QuintaDB

1/7 registries
View full server →