Set Config Plugin JavaScript API doesn't suppport nested object?

Hi there!

I try to make plugin with reading this pages.
https://developer.kintone.io/hc/en-us/articles/212494958/

In Set Config section, config parameter works in this example.


var config = {
  “key1”: “value1”,
  “key2”: “value2”
}
kintone.plugin.app.setConfig(config)

but when I change “value1” and “value2” like this, error happens.

Nested object

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)
>Uncaught Error: Usage: kintone.plugin.app.setConfig(config, opt_callback)

how can I save nested object?

*Edited
Number Data Type also doesn’t seem to work

var config = {
“key1”: 1,
“key2”: 2
}
kintone.plugin.app.setConfig(config)
>Uncaught Error: Usage: kintone.plugin.app.setConfig(config, opt_callback)

Hello Masa!

It seems like the value only accepts text so it needs to be something like the following:

var config = {

  “key1-1”: “value1-1”,

  “key1-2”: “value1-2”,

  “key2-1”: “value2-1”,

  “key2-2”: “value2-2”

}

kintone.plugin.app.setConfig(config);

Hi Yuzo Arai:)

>It seems like the value only accepts text
I understand! I use JSON.stringify() when I use nested object.

Thanks <3