update_selector_element

Admin-only MCP tool.

Update an existing Selector Element in a Formulize form.

Selector Elements have different properties depending on their type.

You must use the valid properties for each type. Here is a complete list of available types, their properties, and examples:

Element: Date Selector (date).

Description: A date selector. The user interface is provided by the browser.

Properties:

  • defaultDate (date, the default date value for the date selector. Provide a value in one of the following formats: YYYY-MM-DD for a specific date, {TODAY} for the current date, {TODAY+7} for a date relative to the current date (accepts any positive or negative integer). Leave blank for no default date.)
  • minDate (date, optional, the minimum date that can be selected. Provide a value in YYYY-MM-DD format.)
  • maxDate (date, optional, the maximum date that can be selected. Provide a value in YYYY-MM-DD format.)

Examples:

  • A date selector that defaults to the current date: { defaultDate: “{TODAY}” }
  • A date selector that defaults to one year before the current date: { defaultDate: “{TODAY-365}” }
  • A date selector that defaults to May 9, 1969: { defaultDate: “1969-05-09” }
  • A date selector with no default date and a minimum date of Jan 1 2020: { minDate: “2020-01-01” }
  • A date selector with no default date and a maximum date of Dec 31 2020: { maxDate: “2020-12-31” }
  • A date selector that defaults to 7 days from today, with a minimum date of today and a maximum date of 30 days from today: { defaultvalue: “{TODAY+7}”, mindate: “{TODAY}”, maxdate: “{TODAY+30}” }

Element: Range Slider (slider)

Description: A line with a knob that can be dragged with a mouse (or with a finger on a touchscreen). The setting of the knob indicates a certain number. Range Sliders are useful for allowing users to pick a number from a range of numbers, without having to type in the number.

Properties:

  • minValue (number, the minimum value for the slider. Default is 0. May be a decimal.)
  • maxValue (number, the maximum value for the slider. Default is 100. May be a decimal.)
  • stepValue (number, the increments allowed for the slider. Default is 10. Use a decimal to allow decimal values, e.g. 0.1 for one decimal place. The database column type is automatically set to decimal with as many places as needed when any of these four values contains a decimal point.)
  • defaultValue (number or empty string, the starting value for the slider. Default is 0. May be a decimal. Special cases: (1) if set to 0 and minValue is greater than 0, the slider starts in a “no value” state — the knob is positioned at the minimum end but no value is stored until the user interacts. Once set, the value cannot return to 0. (2) if set to “” (empty string), the slider starts in “no value” state for any minValue including 0 — NULL is stored until the user interacts. Use this when 0 is your minimum and you still want to require a conscious choice.)

Examples:

  • A range slider where the user can pick any number between 0 and 100, defaults to 50: { minValue: 0, maxValue: 100, stepValue: 1, defaultValue: 50 }
  • A range slider where the user can pick 10, 20, 30, 40, or 50. Default to 10: { minValue: 10, maxValue: 50, stepValue: 10, defaultValue: 10 }
  • A range slider where the user can pick any number from -10 to 10. Default will be 0 since it is not specified: { minValue: -10, maxValue: 10, stepValue: 1 }
  • A range slider where the user rates satisfaction from 1 to 5, but starts with no value selected (user must interact to submit a rating): { minValue: 1, maxValue: 5, stepValue: 1, defaultValue: 0 }

Element: Time Selector (time)

Description: A time selector, the user interface is provided by the browser.

Properties:

  • defaultValue (string, a time in 24H format including colon, or ‘{NOW}’ to show the current time, or ‘{NOW+60}’ for an offset in minutes from the current time.)

Examples:

  • A time selector that defaults to the current time: { defaultValue: “{NOW}” }
  • A time selector that defaults to 7pm: { defaultValue: “19:00” }
  • A time selector that defaults to 90 minutes ago: { defaultValue: “{NOW-90}” }
  • A time selector with no default value: { }

Properties

Property Type Required? Description
element_identifier string or integer Required
caption string Optional

Optional. The new label for the Selector Element as it will now appear to users in forms.

properties object Optional

Optional. Updated configuration settings for the Selector Element. The available properties depend on the element type. See the tool description for examples of what properties are needed for different element types. Use the get_form_details tool to see all the element types for the existing elements.

column_heading string Optional

Optional. The heading to use at the top of a column in lists of entries. If not specified, the caption will be used. Some captions are long and descriptive, and a shorter heading would be more appropriate for in a list of data.

help_text_for_users string Optional

Optional. A longer description or help text for the Selector Element, shown to users filling out the form. This is NOT an internal notes field, this content appears as part of the element.

required boolean Optional

Optional. Whether the Selector Element is required to have a value when users fill out the form. Default: false

principal_identifier boolean Optional

Optional. Whether the Selector Element is the principal identifying element for entries in this form. Principal identifiers are used in various places in Formulize to represent an entry. The Principal Identifier would typically be a ‘Name’ text box or other element that unique identifies the entry. Each form can only have one Principal Identifier. If a form has a Principal Identifier, and another element is created or updated with this value set to true, the existing Principal Identifier will be replaced with the new one. Default: false.

disabled boolean Optional

Optional. Whether the Selector Element element is disabled (visible but not usable) in the form. Default: false.

display boolean Optional

Optional. Whether the Selector Element is displayed in the form or hidden. Default: true.

display_conditions array of object Optional

Optional. A given form entry must meet these conditions in order for this element to be displayed; otherwise it is not shown. Each condition includes an element, an operator, a value, and a ‘type’ flag indicating the logical set the condition belongs to: ‘match-all’ or ‘match-one-or-more’. Multiple match-all conditions are joined with a logical AND operator, and multiple match-one-or-more conditions are joined with a logical OR operator. Only include this property when you intend to change the conditions: omit it entirely to leave any existing conditions unchanged; provide the list of conditions to set or replace them; or provide an empty array ([]) to remove all conditions so the element is always displayed. When setting conditions based on linked elements, do not use foreign keys as values, and instead use the readable value which this tool understands automatically. Use the special value “{BLANK}” (without quotes) to match blank values.
Examples:

  • [ { “element”: “status”, “operator”: “=”, “value”: “Approved”, “type”: “match-all” } ]
  • [ { “element”: “award_value”, “operator”: “>”, “value”: “500”, “type”: “match-all” }, { “element”: “award_year”, “operator”: “=”, “value”: “2026”, “type”: “match-all” } ] Match size 40 pants OR green pants:
  • [ { “element”: “pant_size”, “operator”: “=”, “value”: “40”, “type”: “match-one-or-more” }, { “element”: “pant_color”, “operator”: “=”, “value”: “green”, “type”: “match-one-or-more” } ] Match incomplete orders that are due before today, and are going to either Canada or Mexico:
  • [ { “element”: “order_state”, “operator”: “=”, “value”: “incomplete”, “type”: “match-all” }, { “element”: “order_due_date”, “operator”: “<”, “value”: “{TODAY}”, “type”: “match-all” }, { “element”: “order_destination”, “operator”: “=”, “value”: “Canada”, “type”: “match-one-or-more” }, { “element”: “order_destination”, “operator”: “=”, “value”: “Mexico”, “type”: “match-one-or-more” } ] Do not use foreign key values with linked elements; use the readable value instead:
  • Incorrect: [ { “element”: “assigned_judge”, “operator”: “LIKE”, “value”: “509”, “type”: “match-all” } ]
  • Correct: [ { “element”: “assigned_judge”, “operator”: “LIKE”, “value”: “Wapner”, “type”: “match-all” } ]
placement string Optional

The canonical position of the element in the form. This order is used on every form screen page that this element has been added to (newly created elements are automatically added to all pages that currently have all existing elements; to add an element to a page that has only some existing elements, use the update_form_screen tool). Use “top” to make this element the first element in the form, use “bottom” to make this element the last (which is the default for new elements), or use an element handle to place this element immediately after that element (based on the live state of the form at the time of this specific request; re-fetch get_form_details first if you need to see the current element order). On updates, omit this to leave the current position unchanged.

data_type string Optional

Optional. The MariaDB data type to be used for the field in the database where this data will be stored. The system will default to text in most cases, but will set smart defaults if the type is specifically a number box or a linked element storing foreign keys, etc. Generally this does not need to be specified, but can be used if the user has specifically stated that a certain data type must be used for a given element. Valid types are: text, int(x), decimal(x,y), date, datetime, time, char(x), varchar(x). For int(x), the x is the number of digits to display in MariaDB when showing the number. For decimal(x,y), the x is the total number of digits, and y is the number of digits after the decimal point. For char(x) and varchar(x), the x is the maximum number of characters to store.

← Back to the MCP reference