Skip to content

[Feature]: Bulk operation for loading a table #5821

@kwvanderlinde

Description

@kwvanderlinde

Describe the Problem

Updating large tables one item at a time can be extremely slow. This is largely because table state has to be synced to the server on every change. But when updating entries in a tight loop, I'm not actually interested in all those syncs and would instead like to update the table once, with one server sync at the end.

The Solution you'd like

Add a macro function loadTable(table, data). The data parameter is a JSON array of data to add to the table as rows. Each row is represented as a JSON array with these elements:

  • 0 (int): The lower range of the row's roll
  • 1 (int): The upper range of the row's roll
  • 2 (string): The value of the roll
  • 3 (string): The asset URL to use as the image of the roll.

Existing data would not be overwritten. If that is needed, the clearTable() function should be called first.

Alternatives that you've considered.

No response

Additional Context

I pulled this from Az's PR #4770 for #4769.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAdding functionality that adds value

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions