Help

Re: Get Creation Date

Solved
Jump to Solution
2533 0
cancel
Showing results for 
Search instead for 
Did you mean: 
scb
4 - Data Explorer
4 - Data Explorer

I want to get the creation date of my records and I can't figure out what the variable is.

Is there way I can get it, like I can get the record ID (record.getId()). I have tried record.getDate(), record.createdDate()). 

Here is what I have:

return new Promise((resolve, reject) => {

base('Resource').select({
sort: [
{ field: 'Type', direction: 'asc' }
],
filterByFormula: 'AND({Type} = "'+type+'")'
}).eachPage(function page(records, fetchNextPage) {

records.forEach(function(record) {
console.log(record.getId());
console.log(record.getDate());
});
fetchNextPage();
}, function done(err) {
if (err) {
reject("Promise Rejected");
} else {
resolve(tldList);
}

});

});

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Thanks for the screen shot. Since you can see the createdTime in the object, have you tried getting the value directly, without using a function (record._rawJson.createdTime)? 

See Solution in Thread

4 Replies 4

The library you are using might have been written before Airtable added createdTime of records to its API.

 

Create a “Created” field that shows when the record was created and then use that.

Or use a different library that has support for created time.

Or don’t use a library at all and make your own API calls directly. Then you can refer to the API documentation directly for how to get the createdTime.

I'm using the airtable.js library (https://github.com/Airtable/airtable.js). What library supports created time? I can see the created time when console logging but it's part of _rawJson. So I'm a bit confused on why I can't get created time. 

Screenshot 2023-10-19 at 7.50.58 AM.png

kuovonne
18 - Pluto
18 - Pluto

Thanks for the screen shot. Since you can see the createdTime in the object, have you tried getting the value directly, without using a function (record._rawJson.createdTime)? 

scb
4 - Data Explorer
4 - Data Explorer

That seems to work! Thank you