Skip to content

Department Selection

Description

ItemContent
CategoryControls
Storage TypeTableDepartmentSimple,Array<TableDepartmentSimple>
SortableYes
FilterableYes
Supported Filter TypesContains, Does Not Contain, Equals, Does Not Equal, Is Empty, Is Not Empty, In List, Not In List

Settings

SettingDescription
Allow EmptySet whether the field is required
Multiple SelectionWhen enabled, the department selection will support multiple selections, enabling multiple selection will change the field storage type
Placeholder in Form When EmptyText displayed in the input box when no information is entered in the field
Use Current User's Department as Default ValueWhen enabled, the current user's department will be used as the default value. If the member belongs to multiple departments and department selection is single choice, only the first department will be selected
Display ModeSet the display mode of field content
Options: DefaultText
Display NameSet the display format of department name
Options: NameShort NameFull Path
Use Expression to Calculate ContentYou can use expressions to calculate the display name, for example ${String.substr(value.path,String.indexOf(value.path,'/')+1, value.path.length)} can hide the top-level department in the full path
Use Automation to Set Candidate ListSupport using automation to return candidate list

Note

Because the storage types of single selection and multiple selection are different, enabling/disabling multiple selection may cause data loss, please operate with caution

Database Storage Format

Field TypeDescription
jsonbStore JSON format data, see below for JSON data structure

In the data table, the department selection field data is stored in JSON format. If it is multiple selection, it is stored as a JSON array. The JSON structure is as follows:

ts
interface TableDepartmentSimple {
	id:string;//ID
	name:string;//Name
	shortName:string;//Short Name
	path:string;//Path
}

Use Automation to Set Candidate List

Display Effect

Display Effect