Help:Type Record/Defining a record

For example you would define a property of datatype record like this:

Hence the single fields refer to properties and not to datatypes as in versions of. The use of properties instead of datatypes is better since it allows custom settings beyond the datatype of a field (e.g. conversion factors). In case your are upgrading your wiki containing properties of type record from a version of SMW prior to 1.6.0 to 1.6.0 or above see the instructions on this help page for steps on how to do this.

In a similar way as explained above, you can set any list of properties for the record. It is recommended that the number of fields in a record does not exceed five, but larger records are possible. There are some technical restrictions on record sizes, so record declarations with more than 50 fields are likely to fail. Note that records are already unusable for human editors at much shorter lengths.

When using a record-type property on a page, the values for the individual fields are given as a value, separated by semicolons. If the property "MyRecord" were declared as above, one could write the following annotation on a page:

MyRecord::Some pagename; 1234; some string

Empty values
When setting a value for a record-type property, it is also possible to leave some of the fields unset by leaving them empty or setting question marks:

MyRecord::Some pagename; ?; some string MyRecord::Some pagename;; some string

Values at the end of the record can also be omitted completely:

MyRecord::Some pagename; 1234

Encode ;
Since it is also possible to use a semicolon ";" as part of the property value to be annotated via a property of type "Record".CiteRef::gh:smw:664 Otherwise the semicolon will be treated as a delimiter between the values set. To also add a semicolon to a property value it needs to be escaped like " " e.g.

MyRecord::Some pagename; 1234; some string with \; inbetween