Field property

Tableau field property guide.

Overview

OptionTypeDescription
uniqueboolCheck map key uniqueness.
Default: false.
rangestringFormat: "left, right". E.g.: "1,10", "1,~", "~,10".
Different interpretations of range:
- number: value range.
- string: count of utf-8 code point.
referstringFormat: "SheetName(SheetAlias).ColumnName".
Ensure this field is in another sheet’s column value space. Multiple refers are comma-separated.
sequenceint64Ensure this field’s value is a sequence and begins with this value.
defaultstringUse this default value if cell is empty.
fixedboolAuto-detected fixed size of horizontal list/map.
Default: false.
sizeuint32Specify fixed size of horizontal list/map.
formFormSpecify cell data form of incell struct.
- FORM_TEXT
- FORM_JSON
json_namestringSpecify field’s custom JSON name instead of lowerCamelCase name of proto field name.
presentboolMust fill cell data explicitly if present is true.
Default: false.
optionalboolWhether this field is optional (field name existence).
patchPatchField patch type.
- PATCH_REPLACE
- PATCH_MERGE

Option unique

Option unique can be specified as true in the map field property. Then the tableauc will report an error if a duplicate key is appeared.

Option range

Option range can be specified as format: "left, right" (left and right are both inclusive).

Different interpretations of range:

  • number: value range, e.g.: "1,10", "1,~", "~,10".
  • string: count of utf-8 code point.
  • list: length of list.
  • map: length of map.

Option refer

Option refer is some like the FOREIGN KEY constraint in SQL to prevent actions that would destroy links between tables. However, tableau refer can refer to any sheet’s column even if it is not map key column, and multiple refers (comma-separated) are also supported. It is used to ensure this field is at least in one of the other sheets' column value space (aka message’s field value space).

Format: "SheetName(SheetAlias).ColumnName[,SheetName(SheetAlias).ColumnName]...".

For example:

  • map<uint32, Reward>|{refer:"ItemConf.ID"}: single-refer without alias, so sheet name is just the generated protobuf message name.
  • map<uint32, Reward>|{refer:"ItemConf.ID,EquipConf.ID"}: multi-refer without alias, then sheet alias is the generated protobuf message name.
  • map<uint32, Reward>|{refer:"Sheet1(ItemConf).ID"}: single-refer with alias, then sheet alias is the generated protobuf message name.

Option sequence

Option sequence is used to ensure this field’s value is a sequence and begins with this value, and mainly used for map key and list element.

For example:

  • map<uint32, Item>|{sequence:1}: this map key must follow the sequence rule which begins with value 1.

Option default

If option default is set, then use it as default value if cell is empty.

Option fixed

If option fixed is set as true, then auto-detect fixed size of horizontal list/map.

For example:

Option size

Option size is used to specify fixed size of horizontal list/map.

For example:

Option form

Option form is used to specify cell data form of incell struct.

Two kinds of form can be specified:

For detailed demos, see Advanced predefined incell struct →.

Option json_name

By default, JSON name is deduced from the field’s proto name by converting it to camelCase. Now you can explicitly specify it by json_name prop option.

For example, a worksheet ItemConf in HelloWorld.xlsx:

IDRarity_1SpecialEffect_2
map<int32, Item>int32|{json_name:“rarity_1”}int32|{json_name:“specialEffect_2”}
Item’s IDItem’s rarity.Item’s special effect.
110101
220102
330103

Option present

If option present is set as true, then cell data cannot be empty and must be filled explicitly. Otherwise an error will be reported.

Option optional

Specify whether this field is optional (field name existence).

If set to true, then:

  • table formats (Excel/CSV): field’s column can be absent.
  • document formats (XML/YAML): field’s name can be absent.

Option patch

See field-level patch in Option Patch →.