# Kintone.api('/k/v1/records', 'GET', params) not getting the records

**URL:** <https://forum.kintone.dev/t/kintone-api-k-v1-records-get-params-not-getting-the-records/826>\
**Category:** General\
**Tags:** get-records-api\
**Created:** [August 10, 2023, 2:17am UTC](https://forum.kintone.dev/t/kintone-api-k-v1-records-get-params-not-getting-the-records/826 "2023-08-10T02:17:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![annaylee](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@annaylee](https://forum.kintone.dev/u/annaylee)\
**Post date:** [August 10, 2023, 2:17am UTC](https://forum.kintone.dev/t/kintone-api-k-v1-records-get-params-not-getting-the-records/826/1 "2023-08-10T02:17:28Z")

</div>

I am trying to use the [kintone.api()](https://kintone.dev/en/docs/kintone/js-api/other/kintone-rest-api-request/#kintone-rest-api-request) method in my JavaScript to get records from a Kintone App.

However, it is not getting the App's records. The `response.records.length` is `0` even though the App has records.

Is there any problem with the query string?

```javascript
kintone.events.on("app.record.create.show", function (event) {
  let record = event.record;
  let query = 'proforma_number like "S"';
  let params = { app: 117, query: query };

  return kintone.api("/k/v1/records", "GET", params).then(
    function (response) {
      console.log("response", response);

      let maxNum = "";
      const yyyy = new Date().getFullYear().toString();

      console.log("response.records.length", response.records.length);

      if (response.records.length) {
        let pattern = `S${yyyy}\\d\\d\\d`;
        let regexp = new RegExp(pattern);

        // loop through the response array to find the highest proforma number
        for (let i = 0; i < response.records.length; i++) {
          if (response.records[i]["proforma_number"]["value"]) {
            if (regexp.test(response.records[i]["proforma_number"]["value"])) {
              if (!maxNum) {
                maxNum = response.records[i]["proforma_number"]["value"];
              } else if (
                response.records[i]["proforma_number"]["value"] > maxNum
              ) {
                maxNum = response.records[i]["proforma_number"]["value"];
              }
            }
          }
        }

        if (maxNum == "") maxNum = `S${yyyy}000`;
      } else maxNum = `S${yyyy}000`;

      let last3Plus1 = parseInt(maxNum.slice(-3)) + 1;
      let first5 = maxNum.slice(0, 5);

      let nextProforma = `${first5}${last3Plus1.toString().padStart(3, 0)}`;
      record.proforma_number.value = nextProforma;
      return event;
    },
    function (error) {
      console.log(error);
      return event;
    }
  );

  return event;
});

```

---

<div class="post-metadata">

**Author:** ![Sean\_Tcbn](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/sean_tcbn/32/68_2.png) [@Sean\_Tcbn](https://forum.kintone.dev/u/Sean_Tcbn)\
**Post date:** [August 11, 2023, 11:51pm UTC](https://forum.kintone.dev/t/kintone-api-k-v1-records-get-params-not-getting-the-records/826/2 "2023-08-11T23:51:32Z")

</div>

Hi @annaylee,

I checked the code you provided, and it uses the "like" operator in the query parameter. In the process of retrieving records using the "GET" method of the "kintone" API, when utilizing the "like" or "not like" operators in the query parameter, searches are performed based on [containing/not containing] the specified keywords.

When narrowing down records using the "kintone" REST API, the following search specifications apply:

If the keyword consists of alphanumeric characters, searches can be conducted word-by-word. For example, in the case of records containing "test123," the keyword "test123" is treated as a single word. You can perform searches using exact matches with the keyword "test123." As a result, the following keywords would not lead to successful searches:

・"test"

・"123"

Based on the above information, if you have a query like 'proforma\_number like "S,"' you will not be able to retrieve information such as "S12345."

Please note that if you include characters like "-" between alphanumeric characters, they will be treated as multiple words. Consequently, modifying the data to include characters like "S-12345" would allow for successful data retrieval.

When Searching with Alphanumeric Characters [https://get.kintone.help/k/en/id/040689.html#search\_search\_details\_6020](https://get.kintone.help/k/en/id/040689.html#search_search_details_6020)

When Searching for a String That Consists of Only Alphanumeric Characters

> **[The data I am looking for is not found in search results | Kintone Help](https://get.kintone.help/k/en/trouble_shooting/general/search_qa.html#general_search_qa_20)**
>
> This is the Help for Kintone. This guide describes how to set up and operate Kintone.

Could you kindly explain which data you are experiencing issues with retrieving?

---

<div class="post-metadata">

**Author:** ![Genji](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/genji/32/646_2.png) [@Genji](https://forum.kintone.dev/u/Genji)\
**Post date:** [August 15, 2023, 1:26am UTC](https://forum.kintone.dev/t/kintone-api-k-v1-records-get-params-not-getting-the-records/826/3 "2023-08-15T01:26:36Z")

</div>

Split this topic on August 15, 2023, 1:26am UTC

A post was split to a new topic: ["Private" vs "Public" App?](https://forum.kintone.dev/t/private-vs-public-app/829)
