kintone x Azure Functions (Part 2)


This article continues on from the previous kintone x Azure Functions article: kintone x Azure Functions (Part 1) 

In this article, we will go through how to set up codes that run at scheduled timings (every hour, every day etc) using Azure Functions.


The following is the overview of a the integration in this article.

We will use 2 kintone Apps in this example: an Expense Report App and an Expense Summary App.
Users use the Expense Report App to record their expenses, such as travel expenses. The Expense Report App has a workflow set up, where users will need to get approval from their manager when the expense is submitted.

A scheduled program runs at 2:00AM on the first day of the month, that sums up all of the expenses for each department from last month, and adds a record to the Expense Summary App for each department.


Overview of the integration



List of records containing expenses in the Expense Report App



Details of a record containing expense details and total expenses




List of records in the Expense Summary App with expense totals for each department


Prepare Azure Functions

Follow the steps here to set up Azure Functions.
Choose the "Timer" and "JavaScript" options, as shown in the below image.


In this article, we will use the following packages:

  • request (package to execute HttpRequests)
  • request-promise (package to use Promises)
  • moment (package to operate on dates)

Refer to here on how to install the packages.

kintone App Template

In this example we will use the template provided below, containing the Expense Report App and the Expense Summary App:
AzureFunctions integration (scheduled event).zip

Refer to this help page on how to import App templates, and on this help page on how to create Apps from templates.

JavaScript Code Flow

The code in this integration will process as follows:

  1. Get data of all approved records in the Expense Report App from last month.
  2. Sum up travel expenses by department.
  3. Add a record to the Expense Summary App for each department, containing data of the summed up expenses.

Write the Source Code

Refer to this page for information on where to write the code.

Copy and paste the JavaScript code above into the code editor and modify the kintone subdomain, App ID and API token to fit your kintone environment. Information on generating API tokens can be found on this page.

Set up the Scheduler



Set up the scheduler using Cron expressions in the "Schedule" field.

Use the below table as reference for scheduled timings.


Cron expression

{second} {minute} {hour} {day} {month} {day of the week}

Trigger every 5 minutes

0 */5 * * * *

Trigger every hour

0 0 * * * *

Trigger every two hours

0 0 */2 * * *

Trigger every hour from 9 AM to 5 PM

0 0 9-17 * * *

Trigger every day at 9:30 AM

0 30 9 * * *

Trigger every weekday at 9:30 AM

0 30 9 * * 1-5



Azure Functions is a great way to run codes automatically at a given schedule. We hope you can use this article as reference to use Azure Functions to solve issues you may have for periodically adding or getting to and from kintone Apps.


Was this article helpful?
0 out of 0 found this helpful
Please sign in to leave a comment.