Learn how to create a mobile app in Unifinity that works with kintone.
In this article, we will show you how to use kintone's REST API to advance your kintone workflow.
In my previous article.User Authenticationwill be required, so please check accordingly.
You can download a sample project of the Unifinity kintone application used in the explanation below. We hope you will take advantage of it.
kintone: Workflow Approval Application
Unifinity: kintone workflow approval application
Overview of the application to be created
Create a mobile app in kintone that advances the process (workflow) of a registered record.
Setting up kintone
In this case, we will prepare an application that registers strings as follows.
Please register some kind of record from kintone for the kintone application as we are building an application to advance the workflow.
Then, from the application settings Process Management, set up the workflow referring to the red frame part below. Please check the orange frame area, as it is required for the Unifinity setup.
In addition, the kintone subdomain name, application ID, field code for each field, and action name for process management (orange frame above) are required for linkage.
The subdomain name and app ID can be found in the following part of the URL when connecting to the app.
The field code for each field can be checked from the application's settings screen.
Unifinity collaboration settings
This section explains screen creation and process creation.
For basic Unifinity operation, click here.Tutorial Videosfor more information.
0. Preparation
In my previous article.User Authenticationin the application.
Also, set the global variable for the property to the subdomain name identified in the kintone configuration.
1. screen creation
To update the workflow, it is necessary to set the target record ID, the action name of the process, and the worker of the status to be changed. In actual operation, it is unlikely that users will be asked to input information directly, but since this is a sample, we have made it so that users can input information on the screen.
(1) Place a text box for entering the record ID.
(2) Place a combo box to select an action name for the process.
Also, to set the combo box choices, enter the action name of the kintone process (the orange box in the above figure) in the value input area in the list tab of the data.
(3) Place a text box to enter the worker of the status to be changed.
The worker's login name must be entered here. Also, if there is no subsequent process (in this case, if you choose to complete the process), this should be left blank.
(4) Set up a button to send the entered information to kintone.
Screen creation is now complete (there are areas to be updated after process creation in section 2).
2. process creation
Create the action when the button created on the screen is pressed.
For each item, we will explain the process one by one.
(1) Subdomain name calling
#2 | ."Variable/Global variable acquisitionto read the kintone subdomain set in the global variable. |
(2) Calling user authentication information
#4 | ."Database/RetrievalUse the "User Authentication Information (X-Cybozu-Authorization:●●●)" to read the "User Authentication Information (X-Cybozu-Authorization:●●●)" stored in the DB. (0. described in Preparation)User Authenticationin your application and specify the DB there.) |
(3) Format data into a format for sending to kintone
When registering data in kintone, the format specified by kintone (e.g.This time, here it is.to format the data.
It will need to be formatted into the following format, and we will show you how to do this below.
#6~8 | ."Control/Content AcquisitionSelect what is entered on the screen using the |
#9 | ."Dictionary/CreationThe "I" will be shaped using the "I". {"app": "(ID of the app)", "id": "#6", "action": "#7", "assignee": "#8"}, please select the following The application ID is left blank, but it must be entered. |
#10 |
Finally, the well-formed elements are processed into JSON format. |
(4) Send data to kintone
When registering data in kintone, the URI (URI) specified by kintone (see below) must be used.This time, here it is.to send the data to the (M).
#13 | ."String Functions/Concatenationand generate the RESTAPI URI (https://(subdomain name).cybozu.com/k/v1/record/status.json) as determined by KINTONE. This time, the contents of #2, which invokes the subdomain name, are concatenated with "/k/v1/record/status.json". |
#14 |
."Network/HTTP requestto send data to kintone. |
3. stringing
Then, we ask you to link the screen to the process, and you are done.
In the next issue, we will show you how to create an application to retrieve KINTONE records.
The kintone application and sample projects used in this explanation can be downloaded from the following links.
kintone: Workflow Approval Application
Unifinity: kintone workflow approval application