How to Describe Field Values According to Field Type

Summary

If you want to set something value in a field, such as Set Field Value or Field Mapping, you need to set the value in the appropriate format depending on the destination field type.

The following fields are categorized into several types, and the behavior of each type is explained below. Note that the type classifications here are Customine’s own and not Kintone’s official.

String Type

The field types are as follows:

  • Text
  • Number
  • Text area
  • Rich text
  • Radio button
  • Drop-down
  • Link
  • Lookup
  • Date
  • Time
  • Date and time

If you want to set a fixed value, you can leave the string in the value parameter as is without using an expression.

The expression must be in a format interpreted as a string.

Field values of the same string type can be set as they are.

(OK Example)
= Text

It is also OK if the result of the operation is a string.

(OK Example)
= Number & "yen"

If the expression results in an array, the values are comma-separated. In doing so, empty values are stripped.

(OK Example: Return the checkbox selection values, separated by commas.)
= Checkbox

Fields representing users, groups, or departments are not in a simple string format, so if you try to set them in a string-type field, they will not work as is.

(NG Example: [object Object].)
Created by

In this case, specifying a code or name will work.

(OK Example)
= Author

Datetime Type

The field types are as follows:

  • Date
  • Time
  • Date and time

These fields are also a type of string type. On top of the string type constraint, there are additional formatting constraints.

The symbols such as YYYY below represent:

  • YYYY - 4 digit year
  • MM - 2 digit month (Zero padding)
  • DD - Double digit day (Zero padding)
  • HH - when two digits (Zero padding)
  • mm - 2 digit fraction (Zero padding)
  • ss - 2 digit number of seconds (Zero padding)
Field type Code Example
Date YYYY-MM-DD 2020-07-01
Time HH:MM 06:00
Date and time YYYY-MM-DDTHH:mm:ssZ (ISO8601 format)
or YYYY-MM-DD HH:mm:ss
2020-07-01T08:00:00Z
2020-07-01 17:00

Seconds can be optional.

If the destination is a datetime field, you can set it in any format that can be converted, even if it is not in the format listed in the table above. For example, it can also be set in “YYYY/M/D H:m” format.

The following example sets the destination to the datetime field.

(OK Example)
Date and time_1
(OK Example: Set in the logged-in user's time zone)
= "2020-07-01 09:00"
(OK Example: Combine date fields and time fields and set them to datetime fields)
= date & " " & time
(OK Example: Converted and set)
= "2020-07-01 9:00"

String Array Type

The following Field types are affected:

  • Checkbox
  • Multi-choice

These should specify an array of strings. In Customine, if you specify a string that is not an array, the elements are converted into a single array and set, so you can specify a string that is not an array.

If you want to specify other field values, you can specify string or array types. The elements are assumed to be a single array if specified by string type.

(OK Example)
= ["sample1", "sample2"]
(OK Example)
Checkbox
(OK Example)
= "sample1"
(OK Example)
"Text"

If you set something representing a user, group, or department, the special case is to set an array of its codes (login names).

(OK Example: code (login name) array of the selected User is set)
User selection

User Array Type

These are the following:

  • User selection
  • Group selection
  • Department selection

This type is an array, and the elements are not simple strings, so it is a type to be careful about.

Users, groups, and departments are all represented by a combination of code (login name) and name (display name).

If a string is specified without an expression, it is assumed to be code (login name) and the elements are set as a single array.

Similarly, if the result is a string in an expression, the expression’s result is considered code (login name), and the elements are set as a single array.

(OK Example: Values in String_1 line are assumed to be code and set)
= Text

If you specify an array of strings, they are assumed to be an array of code (login names).

(OK Example)
= ['jane', 'john', 'ken']

Of course, if the result of the expression is a field value of user array type, it will be set as is.

(OK Example)
= User selection_2

The author and updater are not arrays but converted to arrays, so you can specify them as they are.

(OK Example)
= Created by

You can specify the results of [Get Belonging Department of Login User] (../../actions/other/get_user_organization/) or Get Belonging Department of Selected User, if the set destination is the department selection field. Similarly, you can specify the results of Get Belonging Group of the Login User or Get Belonging Group of Selected User, if the destination is a group selection field.

(OK Example: If action #1 is "Get Belonging Department of Login User")
= $1

To specify a guest user, the code (login name) must be “guest/email address”.

(OK Example)
= "guest/xxxxx@r3it.com"

Attachment Type

The types are as follows:

  • Attachment

This is special in Customine because it can be set only by customizing the type of attachments copied in Copy Attachment to be saved while field mapping them to another source record.

It cannot be set by “Set Field Value” etc.

References

Although somewhat technical, please also see the Kintone documentation .