kintone plugin series
Calculation Formula Documentation
In Boost! Action and Boost! Upsert, there is a feature that allows you to input the result of a calculation (function) into a field.
On this page, we will explain what kind of functions can be used. We hope you find this useful and use it according to your situation.
Handling of Fields with Multiple Selections
-
Conversion from Field Value to String
For fields that allow multiple selections, like checkboxes or user selection fields, their values are automatically converted into comma-separated strings for processing. When using these fields as arguments in functions, please keep this in mind.
Checkbox
Multiple SelectionsConverts the selected values into a comma-separated string. Example
"sample1,sample2"
User Selection Converts the usernames into a comma-separated string. Example
"Noboru Sato,Misaki Kato"
Organization Selection Converts the organization names into a comma-separated string. Example
"Development Department,Human Resources Department"
Group Selection Converts the group names into a comma-separated string. Example
"Managers,Leaders"
Assignee Converts the assignee names into a comma-separated string. Example
"Noboru Sato,Misaki Kato"
Creator Converts to the creator's name. Example
"Creator"
Modifier Converts to the modifier's name. Example
"Modifier"
-
Each field format requires a specifically formatted string
For fields that allow multiple selections like checkboxes or user selection fields, even if the values are fixed or the result of calculations, they need to be converted from a string to a data form that matches each field format. Therefore, it's necessary to format them according to the required string format for each field.
Checkbox
Multiple SelectionsFormat the value, whether it's a fixed value or a calculated result, as a comma-separated string. Example
"sample1,sample2"
User Selection Format the value, whether it's a fixed value or a calculated result, as a string separated by commas in the order of "login name: display name". Example
"sato:Noboru Sato,kato:Misaki Kato"
Organization Selection Format the value, whether it's a fixed value or a calculated result, as a string separated by commas in the order of "organization code: organization name". Example
"dev:Development Department,hr:Human Resources Department"
Group Selection Format the value, whether it's a fixed value or a calculated result, as a string separated by commas in the order of "group code: group name". Example
"mgr:Managers,ldr:Leaders"
Specifying a Field as a Function Argument
When specifying a field as a function argument to use its value, enclose the desired field code with percentage signs.
Example
For the field code named "Date1", it returns the age corresponding to the execution time of the process.
AGE(%Date1%)
String Concatenation
If you want to pass a concatenated result of strings or function return values to a field, connect them with the "+" sign.
Example
Convert the value of the "Numeric1" field into a string and return the result combined with another string.
"ABC"+TO_STRING(%Numeric1%)
Function List
- IF
-
Using the IF function, you can change the output value according to the set conditional expression.
-
Input
IF(condition, true value, false value)
-
Args
ConditionCompare the value of the field you want to judge, a fixed value, or the result of a function using a comparison operator.True valueSpecify the output content (fixed value/function result value/arithmetic operation) when the condition is true.False valueSpecify the output content (fixed value/function result value/arithmetic operation) when the condition is false.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
If the Numeric1 field is greater than 100, return "1", otherwise return "0".
IF(%Numeric1%>100,1,0) -
Comparison Operators
=If the string or numerical value is equal, it returns true, otherwise false.!=It is the inverted result of "=".<If the value on the left is smaller than the value on the right, it returns true, otherwise false.<=If the value on the left is less than or equal to the value on the right, it returns true, otherwise false.>If the value on the left is larger than the value on the right, it returns true, otherwise false.>=If the value on the left is greater than or equal to the value on the right, it returns true, otherwise false.
-
- LIKE
-
In the IF function's conditional expression, you use this to determine whether the specified string contains the search value.
-
Input
LIKE(Search target string, Search string)
-
Args
Search target stringYou can specify either a field code, a fixed value, or the result of a function.Search stringYou can specify either a field code, a fixed value, or the result of a function.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
If the "String1" field contains "ABC", return "1". Otherwise, return "0".
IF(LIKE(%String1%,"ABC"),1,0)
-
- AND
-
In the IF function's conditional expression, you use AND to determine whether all the conditions are met.
-
Input
AND(condition1, condition2,...)
-
Usage
If Numeric1 is greater than 100 and String1 is "ABC", then return "1", otherwise return "0".
IF(AND(%Numeric1%>100,%String1%="ABC"),1,0)
-
- OR
-
In the IF function's conditional expression, you use OR to determine whether any of the conditions are met.
-
Input
OR(condition1, condition2,...)
-
Usage
If Numeric1 is greater than 100 or String1 is "ABC", then return "1", otherwise return "0".
IF(OR(%Numeric1%>100,%String1%="ABC"),1,0)
-
- TO_NUMBER
-
Using the TO_NUMBER function, you can convert the value of a field or the result value of a function from a string to a numeric value.
-
Input
TO_NUMBER(%Field code% or result value of function)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.Please enclose the field code with percentage signs and fixed values with double quotations.
If the value to be converted contains anything other than numeric values, 0 is returned.
-
Usage
Convert the value of the String1 field to a numeric value and return the result of multiplying by 2.
TO_NUMBER(%String1%)*2
-
- TO_STRING
-
Using the TO_STRING function, you can convert the value of a field or the result value of a function from a numeric value to a string.
-
Input
TO_STRING(%Field code% or result value of function)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Convert the value of Numeric1 field to a string and return the result by concatenating with another string.
"ABC"+TO_STRING(%Numeric1%)
-
- TODAY
-
Using the TODAY function, you can obtain the Date1 at the time of execution.
-
Input
TODAY()
-
- NOW
-
Using the NOW function, you can obtain the date and time at the time of execution.
-
Input
NOW()
-
- AGE
-
Using the AGE function, you can obtain the age at the time of execution corresponding to the specified date.
-
Input
AGE(%Field code% or result value of a function)
-
Args
Field code or functionSpecify the field code or the result value of a function where the date value for the calculation is entered.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the age at the time of execution corresponding to the Date1 field value.
AGE(%Date1%)
-
- DATE_CALC
-
Using the DATE_CALC function, you can perform date calculations based on the specified content.
-
Input
DATE_CALC(%Field code% or function result value,"Calculation pattern (Add/Subtract value Unit)").
-
Args
Field code or functionSpecify the field code or the result value of a function where the date value for the calculation is entered.Calculation pattern (Add/Subtract value)Specify the number to be added or subtracted from the base value.
A field code can be specified instead of a fixed value.Calculation pattern (Unit)Specify the unit for addition or subtraction.
Yearyear Monthmonth Dayday Hourhour Minuteminute Start of the yearfirst-of-year Start of the monthfirst-of-month Start of the weekfirst-of-week For the start of the year, month, or week, it's not necessary to enter an add/subtract value.Please enclose the field code in percentage signs and the calculation pattern in double quotations.
Insert a half-width space between the add/subtract value and the unit in the calculation pattern.
If you want to perform calculations with multiple patterns, separate each pattern with a comma.
-
Usage
Return the date 2 months before based on the Date1 field.
DATE_CALC(%Date1%,"-2 month")Return the end-of-month date based on the Date1 field.
DATE_CALC(%Date1%,"first-of-month,1 month,-1 day")Return the date added by the Numeric1 field value based on the Date1 field.
DATE_CALC(%Date1%,"%Numeric1% day")Return the date 10 days after the start of the week based on the Date1 field.
DATE_CALC(%Date1%,"first-of-week,10 day")
-
- DATE_DIFF
-
Using the DATE_DIFF function, you can obtain the number of elapsed days for the specified period.
-
Input
DATE_DIFF(%Field code% of the start date,%Field code% of the end date or "TODAY","Display format")
-
Args
Start Date FieldSpecify the field code or the result value of the function where the first date of the period is entered.End Date FieldSpecify the field code or the result value of the function where the last date of the period is entered.
If you want to get the number of days elapsed from the current date, enter "TODAY".Display FormatSpecify the display format
YearY MonthM (This display format contains the remaining months after the elapsed year.) FM (This display format contains the total number of elapsed months.) DayD (This display format contains the remaining days after the elapsed month.) FD (This display format contains the total number of elapsed days.) If you want to get the number of days elapsed from the current date, enter "TODAY".Example
To display the number of elapsed days in years and months
Y years M monthsTo display the number of elapsed days in years, months, and remaining days
Y years M months and D daysPlease enclose the field code with percentage signs and the display format with double quotations.
-
Usage
Return the string converted to the display format of years and months, with Date1 field as the start date and Date2 field as the end date.
DATE_DIFF(%Date1%,%Date2%,"Y years M months")Return the string converted to the display format of years, months, and remaining days, with Date1 field as the start date and today as the end date.
DATE_DIFF(%Date1%,"TODAY","Y years M months and D days")
-
- DATE_FORMAT
-
Using the DATE_FORMAT function, you can convert a date to a string in the specified format.
-
Input
DATE_FORMAT(%Field code% or the result value of a function,"display format")
-
Args
Field code or functionSpecify the field code or the result value of a function where the date value for the calculation is entered.Display FormatSpecify the display format.
YearY Monthm (Two digits padded with zero) Dayd (Two digits padded with zero) HourH (Two digits padded with zero) Minutei (Two digits padded with zero) You can combine year, month, day, hour, and minute in various ways.Example
Connect the year and month with a hyphen.
Y-mConnect the hour and minute with a colon.
H:iPlease enclose the field code with percentage signs and the display format with double quotations.
-
Usage
Return the value of Date1 in the format of year, month, and day.
DATE_FORMAT(%Date1%,"Y-m-d")Return the current time in the format of hour and minute.
DATE_FORMAT(NOW(),"H:i")
-
- LPAD
-
Using the LPAD function, you can pad the current string from the left with another string so that the result string becomes the specified length.
-
Input
LPAD(%Field code% or function result value, String length, character for padding)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.String lengthSpecify the number of characters you want to obtain as a result.Character for paddingSpecify the padding character.The field code is enclosed with percent symbols, and the character for padding is enclosed with double quotes.
-
Usage
Numeric1 field value is padded with zeros to be 10 digits long.
LPAD(%Numeric1%,10,"0")
-
- RPAD
-
Using the RPAD function, you can pad the current string from the right with another string so that the result string becomes the specified length.
-
Input
RPAD(%Field code% or function result value, String length, character for padding)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.String lengthSpecify the number of characters you want to obtain as a result.Character for paddingSpecify the padding character.The field code is enclosed with percent symbols, and the character for padding is enclosed with double quotes.
-
Usage
Numeric1 field value is padded with zeros to be 10 digits long.
RPAD(%Numeric1%,10,"0")
-
- LEFT
-
Using the LEFT function, you can obtain a string from the left side for the specified number of characters.
-
Input
LEFT(%Field code% or the result of a function, extract length)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.Extract lengthSpecify the number of characters you want to extract.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the result of extracting the first 5 characters from the left side of String1.
LEFT(%String1%,5)
-
- RIGHT
-
Using the RIGHT function, you can obtain a string from the right side for the specified number of characters.
-
Input
RIGHT(%Field code% or the result of a function, extract length)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.Extract lengthSpecify the number of characters you want to extract.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the result of extracting the last 5 characters from the right side of String1.
RIGHT(%String1%,5)
-
- MID
-
Using the MID function, you can obtain a string from a specified position for the specified number of characters.
-
Input
MID(%Field code% or the result of a function, starting position, extract length)
-
Args
Field code or functionSpecify the field code or the result value of the function that contains the value to be converted.Starting positionSpecify the position of the character to start the extraction from. (The starting index is 1)Extract lengthSpecify the number of characters you want to extract.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the result of extracting 5 characters starting from the third character of String1.
MID(%String1%,3,5)
-
- REPLACE
-
Using the REPLACE function, you can replace one string with another.
-
Input
REPLACE(%Field code% or the result value of a function, "search", "replacement")
-
Args
Field code or functionSpecify the value that is entered as the original for replacement in the field code or the result of a function.SearchSpecify the string you want to search for. (Regular expressions can also be specified)ReplacementSpecify the string you want to replace.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
If the value of String1 field contains "Co., Ltd.", it returns the result after changing it to "LLC".
REPLACE(%String1%,"Co., Ltd.","LLC")
-
- LEN
-
Using the LEN function, you can obtain the number of characters in a string.
-
Input
LEN(%Field code% or the result value of a function)
-
Args
Field code or functionSpecify the field code with an input value or the result value of a function.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the number of characters in the String1 field value.
LEN(%String1%)
-
- LENB
-
Using the LENB function, you can obtain the number of bytes in a string.
-
Input
LENB(%Field code% or the result value of a function)
-
Args
Field code or functionSpecify the field code with an input value or the result value of a function.Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the number of bytes in the String1 field value.
LENB(%String1%)
-
- LINES
-
Using the LINES function, you can obtain only the specified line of text from a multi-line string.
-
Input
LINES(%Field code% or the result of a function, retrieval line number)
-
Args
Field code or functionSpecify the field code with an input value or the result value of a function.Retrieval line numberSpecify the desired line position (line number).Please enclose the field code with percentage signs and fixed values with double quotations.
-
Usage
Return the third line of text from the MultiLineString1 field value.
LINES(%MultiLineString1%,3)
-
- LOOP
-
Using the LOOP function, you can iterate over each row of a specified table and generate values (fixed strings, functions, formulas), obtaining the results as a new multi-line string.
-
Input
LOOP(%Field code%, /*Formula*/, boolean for limiting target rows)
-
Args
Field codeSpecify the field code of the table to be retrieved.FormulaSpecify the fixed strings, functions, or formulas for generating values.Enclose formulas in "/*" and "*/".
If you need to break a line within a formula, insert "\\n" at the position of the line break.
Boolean for limiting target rowsIf you want to retrieve only rows from the table that match a specified value in a table field based on a condition, specify "true".Please enclose the field code in percent symbols.
-
Usage
For a table with the field code "Table 1," generate values for each row using fields within the table (a "String1" field and a "Numeric1" field), and return multiple lines of text.
LOOP(%Table1%,/*"Item: "+%String1%+"\\nQuantity: "+TO_STRING(%Numeric1%)+"\\n"*/)
Result value»
Item: Orange
Quantity: 10
Item: Apple
Quantity: 15
Item: Kiwi
Quantity: 5The following example is related to the Boost! Action.
Specify the condition that the value of a radio button within the table is a certain value, and for the rows that meet this condition, return new multiple lines of text.
LOOP(%Table1%,/*"String: "+%String1%+"\\nNumber: "+TO_STRING(%Numeric1%)+"\\n"*/,true)
-
- MATH
-
Using the MATH function, you can obtain the result from the specified calculation formula.
-
Input
MATH(Calculation formula)
-
Args
Calculation formulaIf you want to incorporate the value of a field into the calculation formula, specify it with the field code surrounded by percentage signs. -
Available operators
+Addition-Subtraction*Multiplication/Division**Exponentiation -
Usage
Return the result of adding "2" to Numeric1.
MATH(%Numeric1%+2)Return the result of dividing Numeric1 by Numeric2.
MATH(%Numeric1%/%Numeric2%)
-
- MAX
-
Using the MAX function, you can obtain the maximum value from a specified field within a table.
-
Input
MAX(%Field code%, boolean for limiting target rows)
-
Args
Field codeSpecify the field code within the table that contains the date or numeric value you want to retrieve.Boolean for limiting target rowsIf you want to retrieve only rows from the table that match a specified value in a table field based on a condition, specify "true".Please enclose the field code in percent symbols.
-
Usage
Return the maximum value contained in the Numeric1 field, and return the result after adding 1.
MAX(%Numeric1%)+1The following example is related to the Boost! Action.
Specify the condition that the value of the radio button belonging to the table where the Numeric1 field is located has a particular value, and return the result after adding 1 to the maximum value included in the range of rows that meet this condition.
MAX(%Numeric1%,true)+1
-
- MIN
-
Using the MIN function, you can retrieve the minimum value from a specified table field.
-
Input
MIN(%Field code%, boolean for limiting target rows)
-
Args
Field codeSpecify the field code within the table that contains the date or numeric value you want to retrieve.Boolean for limiting target rowsIf you want to retrieve only rows from the table that match a specified value in a table field based on a condition, specify "true".Please enclose the field code in percent symbols.
-
Usage
Return the result of subtracting 1 from the minimum value contained in the Numeric1 field.
MIN(%Numeric1%)-1The following example is related to the Boost! Action.
Specify a condition where the radio button value in the table containing the Numeric1 field is a specific value, and return the result of subtracting 1 from the minimum value within that range of rows.
MIN(%Numeric1%,true)-1
-
- ROWS
-
Using the ROWS function, you can retrieve the number of rows in a specified table.
-
Input
ROWS(%Field code%, boolean for limiting target rows)
-
Args
Field codeSpecify the field code of the table to be retrieved.Boolean for limiting target rowsIf you want to retrieve only rows from the table that match a specified value in a table field based on a condition, specify "true".Please enclose the field code in percent symbols.
-
Usage
Return the number of rows in the table.
ROWS(%Table%)The following example is related to the Boost! Action.
Specify a condition where the radio button value in the table is a specific value, and return the number of rows for that condition.
ROWS(%Table%,true)
-
- WEEK_CALC
-
Using the WEEK_CALC function, you can obtain the day-of-the-week index for a specified date.
-
Input
WEEK_CALC(%Field code% or the result of a function)
-
Args
Field code or functionSpecify the field code or the result value of a function where the date value for the calculation is entered.Please enclose the field code with percentage signs and fixed values with double quotations.
The day-of-the-week index designates Sunday as "0" and Saturday as "6".
-
Usage
Return the day-of-the-week index for the value of Date1.
WEEK_CALC(%Date1%)
-
Fee
While all plugins in the Boost! series can be downloaded and used for free, after a 3-month trial period, a message prompting you to purchase a license will be displayed once a day for each installed app. To use it without displaying this message, you will need to pay an annual fee of 10,000 JPY.
Boost! is based on a domain license, so there is no upper limit to the number of users.
The license and fee apply to the entire Boost! series, not on a per-product basis.
For your interest
This site introduces a series of plugins that extend the functionality of kintone. If you have tried using kintone but feel it does not fit well with your company's operations, we also offer a free open-source web application builder. This tool allows you to easily create a system tailored to your business processes, even without any knowledge of system development. If you are interested, please visit the following URL.
https://pandafirm.jp/en/kumaneko.html