# Is it possible to important Nocodb table record in Excel

**URL:** <https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252>\
**Category:** Uncategorized\
**Created:** [June 29, 2024, 2:35pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252 "2024-06-29T14:35:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony.charrieau](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anthony.charrieau](https://community.nocodb.com/u/anthony.charrieau)\
**Post date:** [June 29, 2024, 2:35pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/1 "2024-06-29T14:35:44Z")

</div>

Hello, I used Excel import Web API and used Nocodb Rest API, I configured a token and put the url I found on the API rest page but it did not work. Is there any page detailing this step by step how to to that ?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Navi](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@Navi](https://community.nocodb.com/u/Navi)\
**Post date:** [June 29, 2024, 2:45pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/2 "2024-06-29T14:45:05Z")

</div>

Sorry, its not clear from the above description. You mentioned excel import API (which?) and NocoDB Rest API (which one?)

Can you provide the link to the APIs that you are referring to and provide a step by step description.

---

<div class="post-metadata">

**Author:** ![anthony.charrieau](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anthony.charrieau](https://community.nocodb.com/u/anthony.charrieau)\
**Post date:** [July 1, 2024, 6:11am UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/3 "2024-07-01T06:11:44Z")

</div>

Here below the full step by step descripton and the challenge I faced:

> **[NocoDB Rest API](https://www.evernote.com/shard/s586/client/snv?isnewsnv=true&noteGuid=c033ed2b-2ae9-7629-a29e-dce6279093c2&noteKey=eUlH5IngEqUnk9n8IfRUWAitvppjS9bwfJzau1inglasCLpW0EbGy6I0KA&sn=https%3A%2F%2Fwww.evernote.com%2Fshard%2Fs586%2Fsh%2Fc033ed2b-2ae9-7629-a29e-dce6279093c2%2FeUlH5IngEqUnk9n8IfRUWAitvppjS9bwfJzau1inglasCLpW0EbGy6I0KA&title=NocoDB%2BRest%2BAPI)**
>
> Step 1: Dashboard Base Step 2: I go get access to the Rest API interface and click on "Authorize" to setup a API Key Step 3: I go in Excel to setup the import But... I

Thank you for your support.

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 1, 2024, 7:11am UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/4 "2024-07-01T07:11:03Z")

</div>

I do not have Excel to try this out. Here is something you can try

1. To talk with NocoDB using APIs, you will need an API Token. You can generate it by using steps listed here [API tokens | NocoDB](https://docs.nocodb.com/account-settings/api-tokens/#create-api-token)
2. Use `xc-token` in the header instead of `xc-auth`

Note that, you do not have to do any configuration in the swagger. Swagger link that we have provided is to try out APIs to look at their response.

---

<div class="post-metadata">

**Author:** ![anthony.charrieau](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anthony.charrieau](https://community.nocodb.com/u/anthony.charrieau)\
**Post date:** [July 1, 2024, 7:30am UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/5 "2024-07-01T07:30:49Z")

</div>

Ok thank you. Once I have generated a token, should I copy it in the “Value” ? or I have to keep it empty ?

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/95b29cecc34acbeeaa9ab2909ac0be8146e687ba.png)

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 1, 2024, 7:50am UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/6 "2024-07-01T07:50:09Z")

</div>

This token is like your password. You need not paste it in Swagger. You need to configure it as value in excel for `xc-token` header

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/6b6b234c71d7f82674c512c25db18659218d8bbd.png)

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 1, 2024, 7:50am UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/7 "2024-07-01T07:50:55Z")

</div>

Use xc-token instead of xc-auth & in the input box next to it, paste your API Token copied from NocoDB

---

<div class="post-metadata">

**Author:** ![anthony.charrieau](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anthony.charrieau](https://community.nocodb.com/u/anthony.charrieau)\
**Post date:** [July 1, 2024, 1:44pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/8 "2024-07-01T13:44:38Z")

</div>

I managed to get connected to my Nocodb with Excel.  
I replaced xc-auth by xc-token and I previsouly indicated in the value filed in NocoDB Rest API interface \> “Authotize” the following code:

{  
“headers”: {  
“xc-token”: “Token value”  
}  
}

Here is my code in Excel Power Query:  
let  
Source = Json.Document(Web.Contents(“[https://app.nocodb.com/api/v2/tables/mlxd59kzoh54d3w/records](https://app.nocodb.com/api/v2/tables/mlxd59kzoh54d3w/records)”, [Headers=[#“xc-token”=“Token value”]])),  
#“Converti en table” = Record.ToTable(Source)  
in  
#“Converti en table”

But I get this result (see picture):

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/13cab94921a4ab1e3f5e5b9b9c2e5f449d13d075.png)

What would be the code to shall all fields and records structured in columns in Excel ?  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 1, 2024, 2:31pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/9 "2024-07-01T14:31:20Z")

</div>

> [@anthony.charrieau](#):
>
> Here is my code in Excel Power Query:  
> let  
> Source = Json.Document(Web.Contents(“[https://app.nocodb.com/api/v2/tables/mlxd59kzoh54d3w/records”](https://app.nocodb.com/api/v2/tables/mlxd59kzoh54d3w/records%E2%80%9D), [Headers=[#“xc-token”=“Token value”]])),  
> #“Converti en table” = Record.ToTable(Source)

You can try something like below; created using GPT, you can try

```auto
let
    // Get the JSON response from the web API
    Source = Json.Document(Web.Contents("https://app.nocodb.com/api/v2/tables/mlxd59kzoh54d3w/records", [Headers=[#"xc-token"="Token value"]])),
    
    // Navigate to the "list" field in the JSON response
    ListField = Source[list],
    
    // Convert the "list" field into a table
    TableFromList = Table.FromList(ListField, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    TableFromList

```

---

<div class="post-metadata">

**Author:** ![anthony.charrieau](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anthony.charrieau](https://community.nocodb.com/u/anthony.charrieau)\
**Post date:** [July 1, 2024, 2:52pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/10 "2024-07-01T14:52:10Z")

</div>

thank you. I tried your script that below the result I get (it is better but not yet what I do expect):

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/f017483a5526a091548cc5b0c6f5d6c822c7aebe.png)

Instead of having 1 unique Column, I would like to get as many columns as the number of field I have in the table “articles” and instead of having “records” that I need to select to see the content, I want to get as many lines with the content of each record per field structured in columns.

And I don’t want to be restricted to 25 records, potentially, if I have 3312 records in my table, I want to extract all of them in a structured table.

Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 1, 2024, 3:03pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/11 "2024-07-01T15:03:18Z")

</div>

- Records will be paginated. You will have to update the script to run in a loop & rely on pageInfo to know if you have reached end of the table
- You can increase number of records that are read in one API invocation by using pageSize query parameter (defaults to 25. you can increase it upto 100). Details here [NocoDB API Documentation](https://data-apis-v2.nocodb.com/#tag/Table-Records/operation/db-data-table-row-list)
- And finally, to dump API response as fields - I am unsure how the field mapping works with Excel Power Query. Something that I am not familiar with.

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 1, 2024, 3:09pm UTC](https://community.nocodb.com/t/is-it-possible-to-important-nocodb-table-record-in-excel/1252/12 "2024-07-01T15:09:23Z")

</div>

Another option would be to try Google spreadsheets & use API Connector Extension. I was able to extract 25 records & map data field wise

 ![Screenshot 2024-07-01 at 8.37.58 PM](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/ebf034f92553f06b0593776eaf877bc4c900a5a1.jpeg)
