Valid query returns error.

When the app has Localization setting for Status and the language is changed, invoke the following code, an error is thrown.

Field code: ステータス

It has English (US) localization setting for Status, and change the language to English.

var body = {
'app': 14078,
'query': '(ステータス in ("Now open")) order by 抽出分類 asc',
  'fields': ['$id', 'Created_by', 'Created_datetime'],
   totalCount: true
};
kintone.api(kintone.api.url('/k/v1/records', true), 'GET', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
// error
  console.log(error);
});

Hello Linner,

 

To clarify:

You have two languages entered in the localization of the app.

When your account language is besides English, the script works fine. However, when you change it to English, it shows an error?

Please correct me if I’m wrong.

 

Also, could you let us know the error that you’re seeing?

 

Thank you,

Chris

Hello, Chris,

Sorry that I didn’t describe it clearly.

Please check it with the following sample:

Test sample - Records (cybozu.com)

UserName: guest

Password: guest123

The status has 4 items, and they have Localization setting for 中文(简体):

When I set Language to 中文(简体), and then invoke the code as I have shown before, an error shows:

{code: ‘GAIA_IQ10’, id: ‘w0VDjo2TAwGtqjVE9IBZ’, message: ‘字段“Status”的项目中没有“未开始”。’}
code: “GAIA_IQ10”
id: “w0VDjo2TAwGtqjVE9IBZ”
message: “字段“Status”的项目中没有“未开始”。”

Code:

var body = {
  'app': 3,
  'query': 'Status in ("未开始")',
  'fields': ['$id', 'Created_by', 'Created_datetime'],
   totalCount: true
};
kintone.api(kintone.api.url('/k/v1/records', true), 'GET', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

 

 

 

 

Hello Linner,

In conclusion, we are still unsure of the cause of the problem.
However, we think the settings may be incorrect after checking each request.

I also wanted to apologize, but in the case of support in Japan, we cannot check the operation by directly logging into the customer’s environment.

Therefore, we have tried to verify the operation based on your provided information, but the cause is still unknown.

However, we noticed that in the second row of the table, the status code for status is changed to “Status.”

> ‘query’: ‘Status in (“未开始”)’,

Please check and see if changing “Status” to " ステータス" will solve the issue.

> ‘query’: ‘ステータス in (“未开始”)’,

It is also possible that the error is caused by referencing a different field, such as a “drop-down” field.
If changing the status field code to Japanese does not resolve the problem, kindly check the following.

  1. Add a record with the status “未开始.”

  2. Set the language to 中文(简体), and then execute the following code at the time mentioned in your original post.

    var body = {
    ‘app’: 3
    };
    kintone.api(kintone.api.url(’/k/v1/records’, true), ‘GET’, body, function(resp) {
    // success
    console.log(resp);
    }, function(error) {
    // error
    console.log(error);
    });

  3. Check the following from within the response obtained in 2.

  • Check if the field code of ステータス (type: “STATUS”) is “Status.”
  • Check that the status value (value) of the record added in 1. is “未开始.”
  1. Obtain a screenshot to show the status of 3.
    (Please send us a screenshot like last time.)

There was no status of “Now open” in the first question, which seems to be the reason for the error.

To add, after setting the language to English, we tested it out and then created a new app.

Then, the field code will be in English.
In that state, add a record by doing “Localization Setting” in 中文(簡体).

If the following process is executed after setting the language to 中文(簡体), the data can be retrieved without any problem.

var body = {
  'app': 5697,
  'query': 'Status in ("未开始")',
  'fields': ['$id', 'Created_by', 'Created_datetime'],
   totalCount: true
};
kintone.api(kintone.api.url('/k/v1/records', true), 'GET', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);

Sean-san,

I have simple steps to reproduce the issue:

  1. Please download from the link and decompress.

  2. Set user language to 中文(简体)

  3. Create a Kintone app with template file: TestSample.zip.

  4. Import data from file: TestData.csv.

  5. Invoke the following code:

    var body = {
    ‘app’: 69905, //Please modify the app code to imported app.
    ‘query’: ‘Status in (“未开始”) order by Drop_down asc’,
    ‘fields’: [’$id’, ‘Created_by’, ‘Created_datetime’],
    totalCount: true
    };
    kintone.api(kintone.api.url(’/k/v1/records’, true), ‘GET’, body, function(resp) {
    // success
    console.log(resp);
    }, function(error) {
    // error
    console.log(error);
    });

Observe the error is thrown: {code: ‘GAIA_IQ10’, id: ‘5GytMtj5OFgJZ4SNcUCt’, message: ‘字段“Status”的项目中没有“未开始”。’}

 

Hi Linner,

Thank you for being patient here.

We are currently checking this matter with our internal team.
We will be updating you shortly.

Thanks,
Sean

Hi Linner

Thank you very much for giving us a great explanation on the issue.

The Kintone programmers have looked into this, and have concluded that it’s a bug.
As you have explained, this bug occurs when the Localization settings is used for the Status names, and the Get Records API is used to retrieve records queried on the Status name. The reason for why the issue occurs on only some domains, is because it seems to relate to the number of records inside the Application.

The issue is being looked into, but we cannot give a sure timeline of when it will be fixed. We’re really sorry for the inconvenience that this will cause. If possible for now, please use the Drop-down field or Check box field to manage the status (whether manually, or automatically copied over from the current status using JavaScript).

Hi, William,

I got it. Thanks for your support.