How to display text from a dataset in code.org?

735 Views Asked by At

I am working on a Dungeons and Dragons app that will eventually show information from the D&D books. So I am trying to display the spell information from a dataset. I have tried using readRecords and updateScreen and it displays on the screen "undefined"

I would very much appreciate any helpful tips with this. https://studio.code.org/projects/applab/VKNZ6xoJsy1ahETdh4R23_-Fs-JI3aF714hsoJqi3qg

1

There are 1 best solutions below

0
On

You would need to move updateScreen(spellOptions, spellTime); from line 87 into the readRecords() block on line 84. You would also need to set spellTime to records[0].time.

Here's what the code should look like from lines 84 to 87:

readRecords("Spells", {name: spellOptions}, function(records) {
  spellTime = records[0].spellTime;
  updateScreen(spellOptions, spellTime);
});