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

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, "info@jasminesoft.co.jp" 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 "@jasminesoft.co.jp" 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.

AND(
  ISINCLUDE(JOIN(${from_address}), "info@jasminesoft.co.jp"),
  NOT(ISBLANK(${user_account})),
  NOT(ISINCLUDE(${user_account}, "@jasminesoft.co.jp")),
  NOT(ISINCLUDE(${subject}, "添付ファイル"))
) ? 1: null

Related pages

The check box manages multiple values ​​as an array. Therefore, when using a function in an expression, please return the value of the array. 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)
)

Related pages