Support > Repository > Initial value > Example of finding initial value by calculation formula
ja | en

Initial values ​​can be described by expressions.

The following example is an example in which an expression is described in the initial value of a radio button item.Set "1" if multiple conditions can be satisfied.Otherwise it sets null and puts the radio button unselected.It is described in one line by using a ternary operator.

In the following example, "" is included in the combination of the character string of the repetition item from_address and the item user_account is not blank and the item user_account contains "@" If all the conditions that the item subject does not contain the character string "attached file" are satisfied, 1 is set as the initial value.Otherwise it is null, that is, no initial value is set.

NOT (ISBLANK ($ {user_account})), NOT (ISINCLUDE ($ {user_account}, "@"), AND (ISINCLUDE (JOIN ($ {from_address}), "" ")), NOT (ISINCLUDE ($ {subject}," attached file ")))? 1: null

[Reference page]

The check box manages multiple values ​​as an array. Therefore, when using a function in an expressionReturns array valueIt is necessary. Even when returning a single value, please use the ARRAY_INT function etc.

Here is an example of changing the initial value of the check box depending on the authority.

IF (HASMODELPERMISSION ("sinsei", "modelA"), ARRAY_INT (1, 2, 3, 4), ARRAY_INT (1))

[Reference page]