- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 12, 2024 04:34 AM
Hi,
I want to export the whole content of my database to google sheet, in order to make advanced analysis in google sheet.
I wrote the following code to do that, which works, but i have an issue with the linked recors. he gives me the airtable code of the records, not what i see in the cell on airtable. Any idea how i can manage that?
I also try to use Bardeen as a work around, but i have the same issue. Linked records come back as RecordID, not as texts.
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 12, 2024 06:29 AM - edited Sep 12, 2024 09:43 PM
Hi,
preferably, please use this tag, otherwise it's not convenient to read the code.
You should change the part with
if Array.isArray.... lenght>0..
return value.join('; ')
Usual value of a link record cell is array of objects having id and name
in JS, it would be value.map(obj=>obj.name).join('; ')
but there are other field types, for example attachments field, which value is array of objects too, but these objects has no 'name' property. You can get their filename (you can get 'url' property and then do something to load into sheet, but be aware that url will be unreachable after a few hours) Lookup fields has no 'name' and 'filename', can be retrieved simple by a value.join. To summarize, it's something like
value.map(v=>v.name||v.filename||v).join('; ')
I don't know whether it work, but you got the idea.
