Set Config

Set Config - kintone.plugin.app.setConfig()

Saves the plug-in configuration settings as an object with a set of keys and values inside.
Only the last saved settings are saved.

This API runs asynchronously.

Function

Desktop

kintone.plugin.app.setConfig(config, successCallback)

Parameters

PARAMETER TYPE REQUIRED DESCRIPTION
config Object yes Specify the configuration as an object, with a set of key and values.
Keys must be ASCII compatible characters.
Values must be strings. The maximum character length is 65535.
Example:{ "key1": "value1", "key2": "value2" }
successCallback Function optional The function to be called after the settings have been successfully saved.There are no parameters.
If this is undefined, null or is not specified, the page will navigate to the plug-in list page and display a message stating the settings have finished.

Returns

Nothing

Available Pages

Desktop

This method can be used in the following pages:

  • Plug-in Settings

Sample

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
(async () => {
  'use strict';
  const config = {
    'key1': 'value1',
    'key2': 'value2'
  };
  await new Promise((resolve) => {
    kintone.plugin.app.setConfig(config, () => {
      resolve();
    });
  });
})();

Error Samples

The following formats are not applicable for the config parameter.

Error case 1: Using nested objects

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
const config = {
  'key1': {
    'key1-1': 'value1-1',
    'key1-2': 'value1-2'
  },
  'key2': {
    'key2-1': 'value2-1',
    'key2-2': 'value2-2'
  }
};

Error case 2: Using integers as values

1
2
3
4
const config = {
  'key1': 1,
  'key2': 2
};

Limitations

  • The maximum data size that can be set with this API for one plug-in is 256KB.