Size issue when using multiple Array parameters in varargs

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 !

1 Like

Hi @Elian_Faggion - I’m sure there are limits to how much data you can pass into a Pack formula, but it would likely be much more than 10 rows worth. In order to troubleshoot we’d either need to look at the customer’s doc or we’d need a way to reproduce the error in a new doc. The code you provided doesn’t give me any clues, and the Chrome console typically doesn’t include errors from Packs.

At this point I’d suggest either:

a) Ask the customer to open a ticket with Coda support, so an engineer can examine the error.
b) Work on creating a new doc that reproduces the error that you can share publicly.

Hi @Eric_Koleda , thanks for your answer. I have asked the client to share her document so that I can have a look at the logs. If I cannot find an explanation I will ask her to open a ticket because I could not reproduce the error.