I am trying to help my church have a lending library. Currently, we have a Google sheet inserted in the Wix site. I am trying to make a better version.
The idea is to import all the books as a .csv file. There are 9 columns in this file. It imports nicely. After importing I've noticed that Wix creates 4 system generated columns. However, when I query the dataset, I get back only 9 with the 4 system generated columns in there?
Can anyone help me figure this out? I am a beginner, trying out different youtube tutorials! My knowledge of Javascript is basic and I am trying to figure out Velo!!
Is there a limit to how many columns one can have in Wix CMS or Data?
const bookLoadResult = await wixData.query('SacredShelfLibrary').limit(1).find();
const totalRowsCount = await wixData.query("SacredShelfLibrary").count();
console.log("totalRowsCount", totalRowsCount);
//setting up Columns and Headers
const fetchHeaderData = bookLoadResult.items;
const headerData = fetchHeaderData[0];
const numberOfColumns = Object.keys(headerData).length;
console.log("numberOfColumns", numberOfColumns);
const bookTableHeaders = Object.keys(headerData);
console.log("bookTableHeaders", bookTableHeaders);
Result: enter image description here

console.log(headerData). Could it be that you're querying an items that doesn't have a value for all fields, so they aren't showing in the returned object?