Form Field Component
Purposeβ
Form Field is a component that wraps a form field and provides a label, description, and error message.
Field Componentβ
Field Component is using Formik for form management. It is a wrapper for Formik's field component. More information about Formik's field component can be found here.
Field Definitionβ
Field definition is used to define the field component. It is used to define the field component in the form.
component: field
name: firstName # component / field name is required
props:
label: First Name # label of the field
type: text # type of the field
Propsβ
label(string): The label of the field. (localized)description(string): The description of the field. (localized)error(string): The error message of the field. (localized)type(string): The type of the field. It acceptstext,number,password,email,checkbox,radio,toggle,select,select-async,textarea,date,time,datetime,rangedatetime,enhanced-rangedatetime,url,tel,file,hidden,image,range.placeholder(string | localized object): The placeholder of the field. Supports plain strings, localization objects like{ en-US: "Enter name", es-MX: "Ingrese nombre" }, and template parsing before localization resolution.defaultValue(string): The default value of the field.items(array): The items of the field. It is used forradioandselecttypes.onEditClick(array): Actions to execute when the edit icon next to a field value is clicked. Available onselect-asyncandautocomplete-asyncfield types when a single value is set. Requiresoptions.navigateActionPermissionfor permission-based visibility.editClickComponent(object): A custom component definition to render in place of the default external-link icon whenonEditClickis configured. Accepts any valid component tree (rendered viaComponentRender).options(object): The options of the field. Options for Formik field component.
Yaml Exampleβ
component: field
name: firstName
props:
label: First Name
type: text
placeholder: Enter your first name
defaultValue: John
Field Typesβ
The following types are supported:
- text
- number
- password
- checkbox
- radio
- toggle
- select
- select-async
- textarea
- date
- time
- datetime
- rangedatetime
- enhanced-rangedatetime
- url
- tel
- secret
- hidden
- file
- image
- range
Textβ
The text type is used for single-line text input.
component: field
name: firstName
props:
label: First Name
type: text
placeholder: Enter your first name
Localized placeholdersβ
Placeholders are resolved consistently across all field types through the same localization pipeline used for labels. A placeholder can be a plain string, a localized object, or a template expression β it is first passed through parseTemplate (resolving any {{ }} variables from the store) and then through localized() (unwrapping locale-keyed objects to the current locale string) before it reaches the inner control.
component: field
name: trackingNumber
props:
label:
en-US: Tracking Number
es-MX: NΓΊmero de rastreo
type: text
placeholder:
en-US: Enter tracking number
es-MX: Ingrese el nΓΊmero de rastreo
The localized() function uses en-US as the preferred locale and falls back to the first available key when en-US is absent. Passing a plain string bypasses locale resolution and is used as-is.
This behaviour applies uniformly to: text, number, password, secret, email, textarea, url, tel, autocomplete, autocomplete-async, autocomplete-googleplaces, select, and select-async.
Text fields and edit actionsβ
Text fields do not render the edit icon for onEditClick. Use select-async or autocomplete-async for fields that should show a related-record edit action next to the label.
Numberβ
The number type is used for input fields that should contain a numeric value.
Options: https://s-yadav.github.io/react-number-format/docs/numeric_format for more details.
component: field
name: age
props:
label: Age
type: number
placeholder: Enter your age
options:
decimalScale: 3
Localized placeholderβ
The placeholder on a number field accepts a localized object:
component: field
name: weight
props:
label: Weight (kg)
type: number
placeholder:
en-US: "Enter weight"
es-MX: "Ingrese el peso"
options:
decimalScale: 2
Passwordβ
The password type is used for password input fields.
component: field
name: password
props:
label: Password
type: password
placeholder: Enter your password
Localized placeholderβ
The placeholder on a password field accepts a localized object:
component: field
name: password
props:
label: Password
type: password
placeholder:
en-US: "Enter your password"
es-MX: "Ingrese su contraseΓ±a"
Emailβ
The email type is used for email input fields.
component: field
name: email
props:
label: Email
type: email
placeholder: Enter your email
Checkboxβ
The checkbox type is used for checkboxes.
component: field
name: terms
props:
label: Terms
type: checkbox
onChange:
- if: "{{ value }}"
then: # if checked
- setStore:
terms: "T"
else: # if unchecked
- setStore:
terms: "N"
onKeyPress: # on key press event for the field
- if: "{{ eval keyCode === 13 }}"
then: # if enter key is pressed
- consoleLog: "Enter key pressed"
Radioβ
The radio type is used for radio buttons.
component: field
name: PaymentMethod
props:
label: Payment Method
type: radio
items:
- label: Credit Card
value: creditCard
- label: PayPal
value: payPal
Toggleβ
The toggle type renders a MUI ToggleButtonGroup. Use allowMultiple: true for multi-select (array value). Button group props such as size, color, and orientation belong under options; legacy top-level exclusive is still accepted, but allowMultiple is preferred.
component: field
name: shipmentMode
props:
label: Shipment Mode
type: toggle
allowMultiple: false
enforceValue: true
defaultValue: parcel
options:
size: small
color: primary
orientation: horizontal
items:
- label: Parcel
value: parcel
- label: LTL
value: ltl
- label: FTL
value: ftl
Selectβ
The select type is used for select dropdowns.
component: field
name: country
props:
label: Country
type: select
options:
allowSearch: true
allowClear: true
allowMultiple: true
allowCreate: true
items:
- label: United States
value: us
- label: Canada
value: ca
Localized placeholderβ
The placeholder on a select field supports the same localized-object format. It takes precedence over the legacy options.placeholder location, which remains supported for backward compatibility.
Fallback priority (highest to lowest):
props.placeholderβ root-level, supports localized objects and template expressionsprops.options.placeholderβ legacy nested location (still works, plain string only)
component: field
name: status
props:
label: Status
type: select
placeholder:
en-US: "Choose a status"
es-MX: "Seleccione un estado"
items:
- label: Active
value: active
- label: Inactive
value: inactive
Select Asyncβ
Select with query is used to load options from a GraphQL query.
component: field
name: country
props:
label: Country
type: select-async
options:
valueFieldName: "countryCode" # if name is different than value field
itemLabelTemplate: "{{value}}"
itemValueTemplate: "{{id}}"
searchQuery:
name: getCountries
path: countries
totalCountPath: totalCount
valueQuery:
name: getCountry
path: country
allowSearch: true
allowClear: true
allowMultiple: false
allowCreate: true
queries:
- name: getCountries
query:
command: "query { countries { id name } }"
variables: { search: "{{search}}" }
- name: getCountry
query:
command: "query { country(id: {{id}}) { id name } }"
variables: { id: "{{id}}" }
dropDownToolbar:
- component: button
name: createCountryBtn
props:
label:
en-US: Create Country
icon: plus
options:
variant: primary
onClick:
- dialog:
component: Countries/CreateCountry
onClose:
- selectValue: "{{ result.countryCode }}"
onSelectValue:
- setStore:
selectedCountry: "{{ selectedItem }}"
onCreateValue:
- mutation:
command: "mutation { createCountry(input: { countryCode: '{{ value }}' }) { countryCode } }"
variables: { value: "{{ value }}" }
Localized placeholderβ
select-async uses a three-level fallback for placeholder text:
props.placeholderβ root-level; supports localized objects and template expressions (highest priority)props.options.placeholderβ legacy nested location (plain string; still supported)- No placeholder rendered
component: field
name: country
props:
label: Country
type: select-async
placeholder:
en-US: "Search for a country"
es-MX: "Busque un paΓs"
options:
searchQuery:
name: getCountries
path: countries
queries:
- name: getCountries
query:
command: "query { countries { id name } }"
variables: { search: "{{search}}" }
Select Async Optionsβ
placeholder(string | localized object): Placeholder text displayed in the dropdown when no value is selected. Supports localized objects (e.g.,{ en-US: "Select...", es-MX: "Seleccione..." }). Root-levelprops.placeholderis preferred overoptions.placeholderβ see Localized placeholder above.itemLabelTemplate(string): The template for the label of the item.itemValueTemplate(string): The template for the value of the item.searchQuery(object): The search query for the select dropdown.valueQuery(object): The value query for the select dropdown.allowSearch(boolean): Allow search in the select dropdown.allowClear(boolean): Allow clear in the select dropdown.allowMultiple(boolean): Allow multiple selection in the select dropdown.allowCreate(boolean): Allow create in the select dropdown.queries(array): The queries for the select dropdown.dropDownToolbar(components): The toolbar component to be displayed in the dropdown.onSelectValue(array): The actions to be executed when a value is selected.onCreateValue(array): The actions to be executed when a value is created.
Select Async Additional Actionsβ
- 'refreshSelect': Reload the selected value from the server.
Custom Edit Click Iconβ
Fields that support onEditClick (select-async, autocomplete-async) display a clickable icon next to the field label when a single value is set. By default this is an external-link icon. Use editClickComponent to render a custom component instead:
component: field
name: country
props:
label: Country
type: select-async
onEditClick:
- navigate:
path: "/countries/{{ fieldValue }}"
editClickComponent:
component: markup
props:
content: '<i class="fas fa-pencil-alt"></i>'
options:
navigateActionPermission: countries.read
valueFieldName: "countryCode"
itemLabelTemplate: "{{value}}"
itemValueTemplate: "{{id}}"
searchQuery:
name: getCountries
path: countries
When editClickComponent is omitted, the default external-link icon is rendered. Any valid component definition is accepted β it is rendered using ComponentRender and receives the current context and variables.
Textareaβ
The textarea type is used for multi-line text input.
component: field
name: description
props:
label: Description
type: textarea
placeholder: Enter your description
options:
rows: 3
Dateβ
The date type is used for date input fields.
component: field
name: date
props:
label: Date
type: date
options:
format: "MM/dd/yyyy"
Timeβ
The time type is used for time input fields.
component: field
name: time
props:
label: Time
type: time
options:
format: "hh:mm a"
Datetimeβ
DateTime and DateTimeRange Options Referenceβ
Overviewβ
This document describes all available options for datetime and rangedatetime field types in the TMS Frontend Web application.
DateTime Optionsβ
The datetime field type supports the following options:
Core Optionsβ
| Option | Type | Default | Description |
|---|---|---|---|
dateFormat | string | "MM/dd/yyyy" | Display format for the date picker. Uses moment.js format tokens. |
showTimeSelect | boolean | false | Whether to show time selection in addition to date. |
showTimeSelectOnly | boolean | false | Show only time picker without date selection. |
timeIntervals | number | 15 | Time selection intervals in minutes (e.g., 15, 30, 60). |
timeCaption | string | "Time" | Label displayed for the time selection section. |
Timezone Optionsβ
| Option | Type | Default | Description |
|---|---|---|---|
useTimezone | boolean | false | Enable timezone-aware date handling. When false, dates are stored as simple strings. |
storeAsUTC | boolean | false | When used with useTimezone: true, converts and stores dates in UTC format. |
timezone | string | undefined | Fixed timezone for display (requires moment-timezone library). |
Storage Formatβ
| Option | Type | Default | Description |
|---|---|---|---|
format | string | undefined | Custom storage format. If not specified, format is determined by other options. |
DateTime Range Optionsβ
The rangedatetime field type supports all datetime options plus:
| Option | Type | Default | Description |
|---|---|---|---|
isClearable | boolean | true | Whether to show a clear button to reset the date range. |
Storage Formats by Configurationβ
Default (Simple Date)β
type: datetime
# Stores as: "2024-03-15"
Date with Timeβ
type: datetime
options:
showTimeSelect: true
# Stores as: "2024-03-15 14:30:00"
Timezone-Aware with UTC Storageβ
type: datetime
options:
showTimeSelect: true
useTimezone: true
storeAsUTC: true
# Stores as: "2024-03-15T19:30:00.000Z"
Timezone-Aware with Local Offsetβ
type: datetime
options:
showTimeSelect: true
useTimezone: true
# Stores as: "2024-03-15T14:30:00-05:00"
Common Use Casesβ
1. Birth Date (Date Only)β
- name: birthDate
component: field
componentProps:
props:
type: datetime
label: Birth Date
options:
dateFormat: "MM/dd/yyyy"
2. Appointment Time (Local Time)β
- name: appointmentTime
component: field
componentProps:
props:
type: datetime
label: Appointment Time
options:
showTimeSelect: true
timeIntervals: 30
dateFormat: "MM/dd/yyyy h:mm aa"
3. International Meeting (UTC Storage)β
- name: meetingTime
component: field
componentProps:
props:
type: datetime
label: Meeting Time (UTC)
options:
showTimeSelect: true
useTimezone: true
storeAsUTC: true
dateFormat: "MM/dd/yyyy HH:mm"
timeCaption: "Time (UTC)"
4. Date Range Filterβ
- name: dateRange
component: field
componentProps:
props:
type: rangedatetime
label: Date Range
placeholder: "Select date range"
options:
dateFormat: "MM/dd/yyyy"
isClearable: true
5. Delivery Window (Date Range with Time)β
- name: deliveryWindow
component: field
componentProps:
props:
type: rangedatetime
label: Delivery Window
options:
showTimeSelect: true
timeIntervals: 60
dateFormat: "MM/dd/yyyy h:mm aa"
6. Time-Only Selectionβ
- name: dailyReminder
component: field
componentProps:
props:
type: datetime
label: Daily Reminder Time
options:
showTimeSelectOnly: true
timeIntervals: 15
dateFormat: "h:mm aa"
timeCaption: "Reminder Time"
Enhanced Range DateTime Filter Modesβ
When used as a DataGrid filter (via enhanced-rangedatetime), the range date picker supports these filter modes:
| Mode | Description | Auto-applies? |
|---|---|---|
today | Filters to today's date only | Yes |
within | Within the last N units | Yes |
more_than | More than N units ago | Yes |
between | Between two specific dates | No (requires Apply) |
empty | Records with no date value (NULL) | Yes |
not_empty | Records that have a date value | Yes |
The Today mode generates a Lucene range query for the current date (e.g., field:["2026-04-05" TO "2026-04-05"]) and auto-applies immediately.
DatePicker and DataGrid Filter Behaviorβ
DatePicker components support two modes:
- Simple Date Format (default): Returns dates as
YYYY-MM-DDwithout timezone - Timezone-Aware Format: Returns ISO 8601 dates with timezone when
useTimezone: true
By default, date filters produce clean range queries: customValues.pickUpDate:["2025-08-03" TO "2025-08-13"] instead of timezone-padded ISO strings.
Year Correction for Typed Partial Datesβ
When users type partial dates like 4/1 (without a year), the component corrects the year to the current year (e.g., 04/01/2026 instead of 04/01/2001). Detection checks for typed input where the parsed year is unreasonably far from the current year.
Select Component Filter Supportβ
The select field type used inside filter columns supports InputProps (e.g., endAdornment) passed from YAML configuration, enabling custom adornments alongside the default dropdown arrow and clear button.
Display Format Tokensβ
Common moment.js format tokens used in dateFormat:
| Token | Output | Description |
|---|---|---|
MM | 01-12 | Month (2 digits) |
M | 1-12 | Month (1-2 digits) |
DD | 01-31 | Day of month (2 digits) |
D | 1-31 | Day of month (1-2 digits) |
YYYY | 2024 | 4-digit year |
YY | 24 | 2-digit year |
HH | 00-23 | Hours (24-hour, 2 digits) |
H | 0-23 | Hours (24-hour, 1-2 digits) |
hh | 01-12 | Hours (12-hour, 2 digits) |
h | 1-12 | Hours (12-hour, 1-2 digits) |
mm | 00-59 | Minutes (2 digits) |
m | 0-59 | Minutes (1-2 digits) |
ss | 00-59 | Seconds (2 digits) |
s | 0-59 | Seconds (1-2 digits) |
a | am/pm | Lowercase meridiem |
A | AM/PM | Uppercase meridiem |
Migration Guideβ
From Individual Props to Options Objectβ
Before (Deprecated):
<ReactDatepickerComponent
id="eventDate"
showTimeSelect={true}
timeIntervals={30}
dateFormat="MM/dd/yyyy h:mm aa"
/>
After (Recommended):
<ReactDatepickerComponent
id="eventDate"
options={{
showTimeSelect: true,
timeIntervals: 30,
dateFormat: "MM/dd/yyyy h:mm aa",
}}
/>
From Timezone-by-Default to Simple Datesβ
Before: Dates were often stored with timezone information by default.
After: Dates are stored as simple strings by default. To enable timezone handling:
options:
useTimezone: true # Must be explicitly enabled
Best Practicesβ
- Use Simple Dates by Default: Unless you specifically need timezone handling, use the default simple date format.
- Be Explicit About Time: If you need time selection, always set
showTimeSelect: true. - Consider User Experience:
- Use appropriate time intervals (15 min for appointments, 60 min for deliveries)
- Provide clear labels with
timeCaption - Use familiar date formats for your locale
- DataGrid Filters: For date range filters in grids, use
rangedatetimewith clear labels. - International Applications: Only use
useTimezone: truewithstoreAsUTC: truefor truly international applications where timezone accuracy is critical.
Troubleshootingβ
Dates showing unexpected timezoneβ
- Check if
useTimezoneis set totrueunintentionally - Verify the stored format matches your expectations
Time not appearing in pickerβ
- Ensure
showTimeSelectis set totrue - Check that
dateFormatincludes time tokens
Range picker not clearingβ
- Verify
isClearableis not set tofalse - Check for any custom validation preventing null values
Format not applyingβ
- Ensure format tokens are valid moment.js tokens
- Check for typos in the
dateFormatstring
Enhanced Range DateTimeβ
The enhanced-rangedatetime type extends the standard rangedatetime picker with additional filter modes. Instead of only selecting a date range, users can choose from multiple filter strategies via a dropdown menu.
Available Filter Modesβ
| Mode | Label | Description |
|---|---|---|
today | Today | Filters to today's date only |
within | Within the last | Relative filter: within the last N days/weeks/months/years |
more_than | More than | Relative filter: more than N days/weeks/months/years ago |
between | Between | Absolute date range with calendar picker |
empty | Empty | Matches records with no date value (NULL) |
not_empty | Not Empty | Matches records that have a date value (NOT NULL) |
Basic Usageβ
component: field
name: dateFilter
props:
label: Date Filter
type: enhanced-rangedatetime
options:
dateFormat: "MM/dd/yyyy"
isClearable: true
Restricting Available Modesβ
Use the modes prop to limit which filter options are displayed. When omitted, all six modes are available.
component: field
name: dateFilter
props:
label: Date Filter
type: enhanced-rangedatetime
modes:
- between
- today
- empty
options:
dateFormat: "MM/dd/yyyy"
In this example, only the Between, Today, and Empty filter options appear in the dropdown. This is useful when certain filter strategies (e.g., relative date filters) don't apply to a given field.
Enhanced Range DateTime Optionsβ
The enhanced-rangedatetime type supports all standard datetime options (dateFormat, showTimeSelect, timeIntervals, etc.) plus:
| Option | Type | Default | Description |
|---|---|---|---|
modes | array | all modes | Array of filter mode identifiers to display. Valid values: today, within, more_than, between, empty, not_empty |
isClearable | boolean | true | Whether to show a clear button to reset the filter |
Storage Formatsβ
The stored value format depends on the selected mode:
- between: Array
["2024-03-01", "2024-03-15"](same asrangedatetime) - today: Object
{ mode: "today", dates: ["2024-03-15", "2024-03-15"] } - within / more_than: Object
{ mode: "within", amount: 7, unit: "days" } - empty: String
"NULL" - not_empty: String
"NOT_NULL"
URLβ
The url type is used for URL input fields.
component: field
name: url
props:
label: URL
type: url
placeholder: Enter your URL
Telβ
The tel type is used for telephone input fields.
component: field
name: phone
props:
label: Phone
type: tel
placeholder: Enter your phone number
Attachmentβ
Attachment type is used for attachment input fields. It will create a new attachment record in the database and return the attachment id.
component: field
name: attachment
props:
label: Attachment
type: attachment
options:
allowMultiple: false
allowClear: true
displayAs: "image" # image, file
previewWidth: 100 # optional
previewHeight: 100 # optional
maxSize: 10485760 # 10MB
allowedExtensions:
- "image/*"
- "application/pdf"
onUploaded:
- consoleLog: "{{ result.attachmentId }}"
Attachment Optionsβ
| Option | Type | Default | Description |
|---|---|---|---|
allowMultiple | boolean | false | Allow uploading multiple files |
allowClear | boolean | false | Show clear/remove button for attachments |
allowCamera | boolean | true | Show camera capture button |
cameraQuality | string | 'high' | Camera quality: 'low', 'medium', 'high', 'maximum' |
captureFormat | string | 'jpeg' | Camera capture format: 'jpeg', 'png' |
instantCamera | boolean | false | Instant capture mode (auto-upload after capture) |
displayAs | string | 'image' | Display mode: 'image' or 'file' |
maxSize | number | 10485760 | Maximum file size in bytes (default 10MB) |
allowedExtensions | array | ['image/*', 'application/pdf'] | Allowed file extensions/MIME types |
previewWidth | number/string | '100%' | Preview width |
previewHeight | number/string | '150px' | Preview height |
parentId | string/number | - | Parent entity ID for linking attachment |
parentType | string | - | Parent entity type (e.g., 'Order', 'Shipment') |
onUploaded | string/array | - | Actions to execute after successful upload |
clearAfterUpload | boolean | false | Clear field after upload, showing success message briefly |
Drop Zone Mode (clearAfterUpload)β
Use clearAfterUpload: true to create a drop zone for uploading files to a parent entity. After upload, a success message displays for 3 seconds, then the field clears automatically, ready for more uploads.
component: field
name: orderAttachment
props:
label: "Upload to Order"
type: attachment
options:
allowMultiple: true
allowCamera: true
clearAfterUpload: true
parentId: "{{ orderId }}"
parentType: "Order"
onUploaded:
- refetch: getOrderAttachments
Behavior:
- User drops/selects files or captures from camera
- Files upload to the parent entity (via parentId/parentType)
- Success message shows: "Uploaded: document.pdf, photo.jpg"
- After 3 seconds, field clears back to empty drop zone
onUploadedaction triggers to refresh attachments elsewhere
Fileβ
The file type is used for file input fields. File type will upload the file to the temp storage and return the file ur
component: field
name: file
props:
label: File
type: file
Secretβ
The secret type is used for fields that store sensitive values (API keys, tokens, credentials). Instead of storing the actual value in the form field, it encrypts the value server-side using the Secrets API and stores a reference in the format ${secret:org/{orgId}/{secretName}}.
Props:
| Prop | Type | Description |
|---|---|---|
secretPath | string | Template expression for the secret name (e.g., "integrations/{{id}}/apiKey"). Resolved against form variables and store context. |
placeholder | string | Placeholder text for the input |
disabled | boolean | Disable the input |
Behavior:
- When a secret is already set, the field displays a chip showing the secret reference (masked) instead of the raw value
- Clicking the edit button reveals a text input to set a new secret value
- On save, the value is encrypted via the
setSecret(input: SetSecretInput!)GraphQL mutation and the field value is updated to the secret reference string - Clearing the secret calls the
deleteSecret(input: DeleteSecretInput!)mutation and removes the reference - Both mutations include the current
organizationIdfrom application state in the input object
component: field
name: apiKey
props:
label: API Key
type: secret
secretPath: "integrations/{{ id }}/apiKey"
placeholder: Enter API key
Secret fields require the Secrets API to be configured on the backend. The stored form value will be a reference string like ${secret:org/42/integrations/1/apiKey}, which is automatically resolved at runtime when the configuration is read.
Hiddenβ
The hidden type is used for hidden input fields.
component: field
name: id
props:
label: ID
type: hidden
defaultValue: 1
Imageβ
The image type is used for image input fields.
component: field
name: image
props:
label: Image
type: image
Rangeβ
The range type is used for range input fields.
component: field
name: range
props:
label: Range
type: range
options:
min: 0
max: 100
step: 1
Field Actionsβ
The following actions are supported:
setValue- Set value for a field. Available for form fields only.
Autocompleteβ
The autocomplete type is used for autocomplete input fields.
component: field
name: country
props:
label: Country
type: autocomplete
options:
allowSearch: true
allowClear: true
allowMultiple: true
allowCreate: true
items:
- label: United States
value: us
- label: Canada
value: ca
Localized placeholderβ
autocomplete, autocomplete-async, and autocomplete-googleplaces all support localized placeholder objects at the root props.placeholder level:
component: field
name: carrier
props:
label: Carrier
type: autocomplete-async
placeholder:
en-US: "Search for a carrier"
es-MX: "Busque un transportista"
options:
searchQuery:
name: getCarriers
path: carriers
queries:
- name: getCarriers
query:
command: "query { carriers { id name } }"
variables: { search: "{{search}}" }
Autocomplete (Draft)β
Autocomplete with query is used to load options from a GraphQL query.
component: field
name: country
props:
label: Country
type: autocomplete
options:
searchQuery:
name: getCountries
path: countries
queries:
- name: getCountries
query:
command: "query { countries { id name } }"
variables: { search: "{{search}}" }
onSelectValue:
- setStore:
selectedCountry: "{{ selectedItem }}"
Autocomplete With Google Placesβ
autocomplete-googleplaces loads address and place suggestions from Google Places. The Google Maps SDK key is read from organization config (apps.google.googleMapsApiKey) and loaded once per organization session by the app shell; individual field definitions should not include API keys.
component: field
name: location
props:
label: Location
type: autocomplete-googleplaces
options:
itemLabelTemplate: "{{ description }}"
searchQuery:
params:
input: "{{ search }}"
types: ["address"]
language: "en-US"
valueQuery:
params:
fields: ["name", "address_components", "formatted_address", "geometry", "place_id"]
onSelectValue:
- setStore:
selectedLocation: '{{ selectedItem }}'
If Google Maps is not configured for the organization, the field waits briefly for the SDK and then shows a configuration error instead of firing Places requests.