Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

How to loop through array of objects with keys

Topic Labels: Scripting
Solved
Jump to Solution
343 5
cancel
Showing results for 
Search instead for 
Did you mean: 

Please how do I loop through a data like this and create a records in airtable 
I got this from an external API and parsed it to json format

array of objects.png

2 Solutions

Accepted Solutions

This is a little rough, but it might help.

See Solution in Thread

Thank you @Bill_French 
I did it this way and it worked perfectly

 

let data_items = data['data'];
let data_objects = Object.values(data_items)
 
After getting the objects I used map  to get the fields and created the records in airtable
let actual_data = data_objects.map((key) => {
return {
fields:{
"Id":key.id,
"Name":key.name,
}
}
});

See Solution in Thread

5 Replies 5

This is a little rough, but it might help.

Thank you @Bill_French 
I did it this way and it worked perfectly

 

let data_items = data['data'];
let data_objects = Object.values(data_items)
 
After getting the objects I used map  to get the fields and created the records in airtable
let actual_data = data_objects.map((key) => {
return {
fields:{
"Id":key.id,
"Name":key.name,
}
}
});

I see you're still around a little, Bill 🙂

Indeed, I'm here by reference, but not by value. 😉

I'm using Airtable's controversial replacement of its community "blog" to work on a project (code-named Sidebar) which uses Coda as a hyper-loop-like approach for more productive knowledge management with AI. It's very rough at this stage but seems relevant and possibly a more streamlined approach for me to contribute. This (for example) just seems a bit more fun for me, and perhaps more useful to those seeking advice.

sidebar.png

Sorry Bill, this is not much 1 Kudo compared to what you bring here.

I had been interested in CODA from a paying account and I had even been allowed to chat with the essential developer Leandro
who launched, among others, airtable pack but then I had to let CODA sleep to carry on some emergencies for me
to achieve between Airtable and Webflow which was more in line with what I had to deliver responsive on my Students' mobiles.

But I still own this CODA account and I wasn't going to give it up on a whim.

I am very aware of what you are proposing here and I am not giving up on the idea of following your suggestion to participate a little
but I don't think I'll find often free time in January until my airtable <-> webflow pairing has provided my Students with some kind of lifepack.
But I thank you for your always constructive and hopeful engagement to share such a way with us!

oLπ