跳转至

Data-backed fields(数据支持字段)

:::callout{theme="warning"} Foundry Forms is no longer the recommended approach for data entry or writeback workflows on Foundry. Instead, build user input workflows with the Foundry Ontology, representing the relevant data structures as object types and configuring the writeback interaction with Actions. Learn more in the Forms overview documentation. :::

Data-backed fields link a form to data that already exists in Foundry. This page discusses the seven types of data-backed fields available in Foundry Forms.

User dropdown

The user dropdown field allows respondents to select a Foundry user. The field displays the name of the userc but records the user ID. Users can configure the following options:

  • Allow multiple selections.
  • Prefill the field if only one value is available.
  • Set a Placeholder.
  • Hide the list of selected users below the dropdown.
  • Use the Code Editor to set onlyUsersInGroupIds: list<string>.

Object dropdown

The object dropdown field allows respondents to select an object of a given type. This field displays the title of the object but records its primary key. Users can configure the following options:

  • Specify a filter based on the value of a property.
  • Specify which properties should be searched on.
  • Allow multiple selections.
  • Prefill the field if only one value is available.
  • Show a preview of the hovered object's properties.
  • Hide the object type icon.
  • Set a Placeholder.
  • Use the Code Editor to set noResultsText: string and displayedProperties: list<string>.

:::callout{theme="neutral"} To be filtered on, properties must be configured with the render hint "Low cardinality" in the Ontology. :::

Object property dropdown

The object property dropdown field allows respondents to select a property value of a given object type. Users can configure the following options:

  • Specify a filter based on the value of another property.
  • Allow multiple selections.
  • Prefill the field if only one value is available.
  • Allow the creation of values other than the ones given.
  • Set a Placeholder.
  • Use the Code Editor to set noResultsText: string.

Dataset value dropdown

The dataset value dropdown field allows respondents to select a column value of a given dataset. Users can configure the following options:

  • Specify a filter based on the value of another column.
  • Allow multiple selections.
  • Prefill the field if only one value is available.
  • Allow the creation of values other than the ones given.
  • Set a Placeholder.
  • Use the Code Editor to set noResultsText: string.

:::callout{theme="neutral"} To use this field, the dataset must be indexed into Lime. :::

Objects provider

The objects provider field is read-only and shows chosen objects of a given type. Users can configure the following options:

  • Specify a filter based on the value of a property.
  • Display a summary view or a collapsible list of all objects.
  • Use the Code Editor to set maxObjects: integer.

Object property display

The object property display field is read-only and shows the selected property of a chosen object. Users can configure the following options:

  • Specify the primary key of the object or the field that references it.
  • Hide the object type icon.
  • Customize the message when:
  • No object is selected.
  • The value is empty.
  • The request fails.
  • The object is "missing" (either does not exist or the respondent does not have the appropriate permissions).
  • Specify what to do when:
  • The request fails.
  • The object is "missing".

If referencing a field with multiple selection enabled, the object property display will show the properties of all of the objects, separated by commas.

User properties

The user properties field is read-only and shows the selected property of a chosen Foundry user. Users can configure the following options:

  • Specify the user ID or the field that references it.
  • Specify the format (for example, Last name, first name).
  • Customize the message when:
  • No user is selected.
  • The value is empty.
  • The request fails.
  • The user is "missing" (either does not exist or the respondent does not have the appropriate permissions).
  • Specify what to do when:
  • The request fails.
  • The user is "missing".

If referencing a field with multiple selection enabled, the user property display will show the properties of all of the users, separated by commas.


中文翻译

数据支持字段

:::callout{theme="warning"} Foundry Forms 已不再是 Foundry 中数据录入或回写工作流的推荐方案。请改用 Foundry Ontology 构建用户输入工作流,将相关数据结构表示为对象类型,并通过 Actions 配置回写交互。更多信息请参阅 Forms 概述 文档。 :::

数据支持字段(Data-backed fields)将表单与 Foundry 中已存在的数据关联起来。本文介绍 Foundry Forms 中可用的七种数据支持字段。

用户下拉框

用户下拉框(user dropdown)字段允许受访者选择一位 Foundry 用户。该字段显示用户名,但记录的是用户 ID。用户可以配置以下选项:

  • 允许多选
  • 当仅有一个可用值时自动预填字段。
  • 设置占位符(Placeholder)。
  • 隐藏下拉框下方已选用户的列表。
  • 使用代码编辑器设置 onlyUsersInGroupIds: list<string>

对象下拉框

对象下拉框(object dropdown)字段允许受访者选择指定类型的对象。该字段显示对象的标题,但记录其主键。用户可以配置以下选项:

  • 根据属性值指定筛选条件。
  • 指定需要搜索的属性。
  • 允许多选
  • 当仅有一个可用值时自动预填字段。
  • 显示悬停对象的属性预览。
  • 隐藏对象类型图标。
  • 设置占位符
  • 使用代码编辑器设置 noResultsText: stringdisplayedProperties: list<string>

:::callout{theme="neutral"} 要启用筛选功能,相关属性必须在 Ontology 中配置为"低基数"(Low cardinality)渲染提示。 :::

对象属性下拉框

对象属性下拉框(object property dropdown)字段允许受访者选择指定对象类型的属性值。用户可以配置以下选项:

  • 根据其他属性值指定筛选条件。
  • 允许多选
  • 当仅有一个可用值时自动预填字段。
  • 允许创建给定值之外的新值。
  • 设置占位符
  • 使用代码编辑器设置 noResultsText: string

数据集值下拉框

数据集值下拉框(dataset value dropdown)字段允许受访者选择指定数据集的列值。用户可以配置以下选项:

  • 根据其他列值指定筛选条件。
  • 允许多选
  • 当仅有一个可用值时自动预填字段。
  • 允许创建给定值之外的新值。
  • 设置占位符
  • 使用代码编辑器设置 noResultsText: string

:::callout{theme="neutral"} 要使用此字段,数据集必须索引到 Lime 中。 :::

对象提供器

对象提供器(objects provider)字段为只读字段,显示指定类型的已选对象。用户可以配置以下选项:

  • 根据属性值指定筛选条件。
  • 显示摘要视图或所有对象的可折叠列表。
  • 使用代码编辑器设置 maxObjects: integer

对象属性显示

对象属性显示(object property display)字段为只读字段,显示已选对象的指定属性。用户可以配置以下选项:

  • 指定对象的主键或引用该对象的字段。
  • 隐藏对象类型图标。
  • 自定义以下情况的消息:
  • 未选择对象时。
  • 值为空时。
  • 请求失败时。
  • 对象"缺失"(不存在或受访者没有相应权限)时。
  • 指定以下情况的处理方式:
  • 请求失败时。
  • 对象"缺失"时。

如果引用的字段启用了多选,对象属性显示将显示所有对象的属性,以逗号分隔。

用户属性

用户属性(user properties)字段为只读字段,显示已选 Foundry 用户的指定属性。用户可以配置以下选项:

  • 指定用户 ID 或引用该用户的字段。
  • 指定格式(例如"姓, 名")。
  • 自定义以下情况的消息:
  • 未选择用户时。
  • 值为空时。
  • 请求失败时。
  • 用户"缺失"(不存在或受访者没有相应权限)时。
  • 指定以下情况的处理方式:
  • 请求失败时。
  • 用户"缺失"时。

如果引用的字段启用了多选,用户属性显示将显示所有用户的属性,以逗号分隔。