Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NocoDB : can't return more than 100 rows #2866

Closed
branch3 opened this issue Feb 22, 2022 · 3 comments · Fixed by #3081
Closed

NocoDB : can't return more than 100 rows #2866

branch3 opened this issue Feb 22, 2022 · 3 comments · Fixed by #3081

Comments

@branch3
Copy link

branch3 commented Feb 22, 2022

Describe the bug
Using NocoDB's node, the operation Get All returns a maximum of 100 lines, ignoring the options Return All or Limit :

  • it's not taking into account the Return All option (checked or not)
  • it's not taking into account the user-defined Limit if set to more than 100.

To Reproduce
Steps to reproduce the behavior:

  1. You'll need a NocoDB table with more than 101 rows
  2. Set your NocoDB node to your NocoDB account, project ID, and table
  3. Set Resource=Row, Operation=Get All
  4. Try with Return All=True and with Return All=False AND Limit=200
  5. Execute node and see that it can't return more than 100 rows

Expected behavior
The NocoDB Node in Get All mode should return all the rows of the NocoDB table when the Return All option is True, even if the NocoDB table has more than 100 rows.
The Limit option should allow us to set values higher than 100

Environment:

  • n8n Version 0.162.0

Environment NocoDB:

  • Node: v12.22.6
  • Arch: x64
  • Platform: linux
  • Docker: true
  • ProjectOnRootDB: true
  • RootDB: mysql2
  • PackageVersion: 0.84.8

Additional context
You can try using the following workflow to fill a test_table, and try to retrieve all from it.

  1. Create a table in NocoDB "test_table" with columns [id, title]
  2. Set your NocoDB account and project ID on all 3 NocoDB nodes
  3. Execute node Create rows
  4. Execute node Get All
  5. Try with Return All=True and with Return All=False AND Limit=200
  6. See that it can't return more than 100 rows
{
  "nodes": [
    {
      "parameters": {},
      "name": "NocoDB Delete multiple",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        240,
        960
      ]
    },
    {
      "parameters": {
        "functionCode": "item.ids = [];\n\n// delete ids that are between :\nconst delete_from_id = 1;\nconst delete_to_id = 100;\n\n// It generates an array of items²\nfor (var i=delete_from_id; i<=delete_to_id; i++){\n  item.ids.push({\"id\":i});\n}\n\nreturn item;"
      },
      "name": "Set ids to delete",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        480,
        960
      ]
    },
    {
      "parameters": {
        "fieldToSplitOut": "ids",
        "options": {}
      },
      "name": "Split list in items",
      "type": "n8n-nodes-base.itemLists",
      "typeVersion": 1,
      "position": [
        700,
        960
      ],
      "notesInFlow": false
    },
    {
      "parameters": {
        "operation": "delete",
        "table": "n8n_mail_premium_HackFreeUsersSameMail",
        "id": "={{$json[\"id\"]}}"
      },
      "name": "Delete rows",
      "type": "n8n-nodes-base.nocoDb",
      "typeVersion": 1,
      "position": [
        940,
        960
      ],
      "credentials": {
        "nocoDb": {
          "id": "23",
          "name": "NocoDB account"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "ids",
        "options": {}
      },
      "name": "Split list in items1",
      "type": "n8n-nodes-base.itemLists",
      "typeVersion": 1,
      "position": [
        700,
        520
      ],
      "notesInFlow": false
    },
    {
      "parameters": {},
      "name": "NocoDB Fill test_table",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        240,
        520
      ]
    },
    {
      "parameters": {
        "functionCode": "item.ids = [];\n\n// how many empty rows to create\nconst nb_rows = 110;\n\n// It generates an array of items²\nfor (var i=0; i<nb_rows; i++){\n  item.ids.push({\"id\": i});\n}\n\nreturn item;"
      },
      "name": "Set number of rows",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        480,
        520
      ]
    },
    {
      "parameters": {
        "operation": "create",
        "table": "test_table",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldName": "title",
              "fieldValue": "test"
            }
          ]
        }
      },
      "name": "Create rows",
      "type": "n8n-nodes-base.nocoDb",
      "typeVersion": 1,
      "position": [
        940,
        520
      ],
      "credentials": {
        "nocoDb": {
          "id": "23",
          "name": "NocoDB account"
        }
      }
    },
    {
      "parameters": {},
      "name": "NocoDB Try GetAll",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        240,
        740
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "table": "test_table",
        "options": {}
      },
      "name": "Get All",
      "type": "n8n-nodes-base.nocoDb",
      "typeVersion": 1,
      "position": [
        480,
        740
      ],
      "notesInFlow": true,
      "credentials": {
        "nocoDb": {
          "id": "23",
          "name": "NocoDB account"
        }
      },
      "notes": "It can't retrieve more than 100 rows regardless of options set"
    }
  ],
  "connections": {
    "NocoDB Delete multiple": {
      "main": [
        [
          {
            "node": "Set ids to delete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set ids to delete": {
      "main": [
        [
          {
            "node": "Split list in items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split list in items": {
      "main": [
        [
          {
            "node": "Delete rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split list in items1": {
      "main": [
        [
          {
            "node": "Create rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB Fill test_table": {
      "main": [
        [
          {
            "node": "Set number of rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set number of rows": {
      "main": [
        [
          {
            "node": "Split list in items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB Try GetAll": {
      "main": [
        [
          {
            "node": "Get All",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
@branch3 branch3 changed the title NocoDB : can't return all rows NocoDB : can't return more than 100 rows Feb 22, 2022
@Joffcom Joffcom added the node/issue Issue with a node label Mar 21, 2022
@Joffcom
Copy link
Member

Joffcom commented Apr 1, 2022

Hey @branch3,

Thanks for the workflow to reproduce this one, I have just popped in a PR that should fix this 👍🏻

@Joffcom Joffcom removed the node/issue Issue with a node label Apr 1, 2022
@Joffcom Joffcom linked a pull request Apr 1, 2022 that will close this issue
@janober janober added the Upcoming Release Will be part of the upcoming release label Apr 1, 2022
@janober
Copy link
Member

janober commented Apr 3, 2022

Fix got released with n8n@0.171.0

@janober janober removed the Upcoming Release Will be part of the upcoming release label Apr 3, 2022
@branch3
Copy link
Author

branch3 commented Apr 13, 2022

Thank you for the work ! Have a great day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants