Pack to import multiple rows in a table - Formula or Sync Table?

I know how to make a Pack to create a Formula or to create a Sync Table.

What I need now for a related project is perhaps a “non-Sync Table.”

Basically I want to be able to take an existing Coda table and add to that an import of multiple rows/columns from an API.

I do know how to do this with a Button that does a “For Each” and retrieves each cell manually for each column within multiple rows. I have that working now but it has limitations because the API I am using prefers one large API call rather than one call for each cell of the table.

So essentially I want to create a pack which retrieves an array of data and then lets me add that data to an existing table. What is the big-picture data structure for me to do that with a Pack?

Is this doable? Any thoughts?

Hi @Richard_Kaplan - Sorry for the slow reply, I was OOO last week. The SDK doesn’t include a “non-sync table”, but I think you can replicate this by:

  1. Creating a Pack formula that returns an array (list) of items.
  2. Use the RunActions() and FormulaMap() formulas to loop over the results and run AddRow() for each item.

The button formula would look something like:

RunActions(
  MyPack::GetTasks().FormulaMap(
    AddRow(MyTable, TaskName, CurrentValue.Name)
  )
)

Let me know if that makes sense.

Yes that makes sense… thanks