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.

Function

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. The maximum character length is 64.
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

This method can be used in the following pages:

  • Plug-in Settings

Sample

1
2
3
4
5
var config = {
  'Number Field Code': 'number_field',
  'Font Color': '#8bc534'
};
kintone.plugin.app.setConfig(config);

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
11
var config = {
  'key1': {
    'key1-1': 'value1-1',
    'key1-2': 'value1-2'
  },
  'key2': {
    'key2-1': 'value2-1',
    'key2-2': 'value2-2'
  }
};
kintone.plugin.app.setConfig(config);

Error case 2: Using integers as values

1
2
3
4
5
var config = {
  'key1': 1,
  'key2': 2
};
kintone.plugin.app.setConfig(config);