Hi,
using the docMaker pack, a user reported an issue when trying to send line items data from multiple tables, but only when those tables each had more than 10 line items .
I am struggling to understand why it would work with less than 10 lines per array but not when there are more.
Is there a size limit to the data a table row may contain ? i.e. the consolidation of line_items JSON in a single cell of the main table could fail ? In this case how to consolidate line items in one JSON array ?
Or is there a size limitation on strings/ arrays in varargs?
Here is the code I have used to parse arrays in varargs :
while (args.length > 0) {
let [key, value, ...remainingArgs] = args;
let correctedValue = `[${value}]`;
if (value.toLowerCase() === "true") {
myData[key] = true;
} else if (value.toLowerCase() === "false") {
myData[key] = false;
} else {
// Attempt to parse the string as a JSON array
try {
let parsedArray = JSON.parse(correctedValue);
// Check if the parsed object is an array
if (Array.isArray(parsedArray) && parsedArray.every(item => typeof item === 'object' && item !== null)) {
myData[key] = parsedArray;
console.log("It is an array:", parsedArray);
} else {
console.log("It is not an array.");
myData[key] = value;
}
} catch (error) {
console.error("Parsing error:", error);
myData[key] = value;
}
}
args = remainingArgs;
}
And here is a screenshot of the developer console when the user gets the error :
Thanks for your help !