# Using Data tools: readRecords vs getColumn

**URL:** <https://forum.code.org/t/using-data-tools-readrecords-vs-getcolumn/37596>\
**Category:** CS Principles\
**Tags:** csp-unit-3, csp-unit-5\
**Created:** [February 4, 2023, 8:02pm UTC](https://forum.code.org/t/using-data-tools-readrecords-vs-getcolumn/37596 "2023-02-04T20:02:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jdonwells](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jdonwells/32/7900_2.png) [@jdonwells](https://forum.code.org/u/jdonwells)\
**Post date:** [February 5, 2023, 2:06am UTC](https://forum.code.org/t/using-data-tools-readrecords-vs-getcolumn/37596/3 "2023-02-05T02:06:06Z")

</div>

`getColumn` is implemented the same as readRecords. The difference is that App Lab provides the callback function. See also [getColumn: one common error and one subtle error explained](https://forum.code.org/t/getcolumn-one-common-error-and-one-subtle-error-explained/34355).

The difference is as follows, `readRecords` tells you when the data is available through a callback. If you want to know when two pieces of data are available just wait till the last of the two finishes to start to process the data.

`getColumn` uses a built in callback function written in the native Javascript. That means it runs about 200 times faster than any callback function you can write. That reduces the risk of trying to use data that isn’t there yet but doesn’t eliminate it.

Do you want fast or reliable?

I would just do something like this:

```javascript
var HistoricalNonViolentResistances;
var Dogs;
var historicalNonViolentDone = false;
var dogsDone = false;

readRecords("Historical Non-violent Resistances",{}, function (data) {
  historicalNonViolentDone = true;
  HistoricalNonViolentResistances = data;
  if (dogsDone) {
    doIt();
  }
});

readRecords("Dogs",{}, function (data) {
  dogsDone = true;
  Dogs = data;
  if (historicalNonViolentDone) {
    doIt();
  }
});

function doIt(){
  console.log(HistoricalNonViolentResistances[HistoricalNonViolentResistances.length-1]);
  console.log(Dogs[Dogs.length-1]);
}

```

---

_[View the full topic](https://forum.code.org/t/using-data-tools-readrecords-vs-getcolumn/37596)._
