I've watched several tutorial videos of WixWiz on youtube. Thank you for those helpful videos!
I am trying to help my church create a lending library. The page is not live because eveything in it is broken! I have created a dataset with 9 columns. I understand that there will be system generated columns. However when I am trying to get the columns, I see to get only 4 or 5 columns!
Here is my code:
const bookLoadResult = await wixData.query('Import1').limit(1).find();
const firstItem = bookLoadResult.items[0];
// Filter out fields that start with an underscore
const customFields = Object.keys(firstItem).filter(field => !field.startsWith('_'));
const numberOfCustomColumns = customFields.length;
console.log('Number of custom columns:', numberOfCustomColumns);
Here's the result:
Number of custom columns: 4
numberOfColumns 8
bookTableHeaders
Array(8)jsonTableCopy JSON
0: "author"
1: "_id"
2: "_owner"
3: "_createdDate"
4: "_updatedDate"
5: "bookCopies"
6: "available"
7: "title"
The ordering of the columns are also different. I have tried creating everything I need as a .csv and importing.
Sometimes, the maximum number of columns it seems to fetch is 9(including system generated columns)! What can I do? Or..... Is this because of my payment plan tier?
Hi Everyone,
I got the answer from stack overflow! The columns were empty when uploaded. That's why they weren't showing up. Once I filled them with dummy values, it loaded. Here's the answer: https://stackoverflow.com/questions/79678770/is-there-a-limit-to-the-number-of-columns-that-can-be-accessed-in-a-wix-dataset
We can mark this question as solved!