Home/DriveWorks guides/DriveWorks Simple Tables vs Group Tables: why runtime writes disappear

DriveWorks Simple Tables vs Group Tables: why runtime writes disappear

Anything a specification writes to a Simple Table lasts only for that specification. The next new specification loads the table's original design-time data. To keep rows permanently, or share them between projects, write to a Group Table with the Update Group Table Using Array task, or to a SQL table.

The behavior

DriveWorks has tasks that change a Simple Table while a specification is running: writing an array into it, updating a column, importing lines from a text file or a sheet from Excel, deleting rows. It is natural to expect those changes to be saved in the project. They are not.

The DriveWorks documentation is explicit: when these features run, "any change will only persist in the specification they are executed in." The project's original data is unaffected, and a new specification starts from the original table again. See Define Tables.

So no project, not even the one that owns the table, can permanently add rows to a Simple Table at runtime.

Why this catches people

The symptom looks like a bug:

  • A maintenance form adds a row. It appears in the list. The user closes the specification.
  • The next specification opens with the old data, and the new row is gone.

Nothing failed. The task reported success, because the write did happen, inside that one specification.

Which table to use

Need Use Why
Reference data that changes only when the project is edited Simple Table Fast, stored in the project, edited at design time
Working data for one specification (a filtered list, an imported file) Simple Table, written at runtime The data should not outlive the specification anyway
Rows added by users that every later specification must see Group Table Stored at group level and changed at runtime
Data shared between several projects Group Table One table, readable from every project in the group
Data other systems also read or write SQL Server table Outside DriveWorks, with the database's own tools and security
Values calculated live during a specification Calculation Table Rules per row and column, evaluated as inputs change

Writing to a Group Table

A Group Table belongs to the group, not to one project, so every project in the group can read it. In rules it is referenced by its DWGroupTable name.

To write to it at runtime, use the Specification PowerPack task Update Group Table Using Array:

  • With control columns set, the task behaves as insert-or-update. A row whose control column values match is overwritten; otherwise the row is appended.
  • With the column names left blank, rows are appended.

There is a matching Delete Group Table Rows task for removing rows.

Two practical points:

  • The task has been part of the Specification PowerPack for many versions (the DriveWorks 15 release notes already list it). If you support an older installation, check before designing around it.
  • Group Tables are not built for heavy traffic. The DriveWorks documentation says they "are not designed for large volumes of transient data updated by multiple specifications simultaneously" and recommends a SQL database for that.
  • If Autopilot is running when a new Group Table is created, close and reopen Autopilot so it sees the table.
  • Group Tables are part of DriveWorks Pro. They are not available in DriveWorks Solo or DriveWorksXpress.

When SQL is the better home

A SQL Server table is the right choice when the data is not really DriveWorks data: order history, a job queue, anything a report or another system reads. DriveWorks can query it in rules and write to it from macros, and it does not depend on the group being open. Another reason to put it into SQL is size. Because group tables are compressed and stored for the group, they can become slow performers. Finally, if you have other systems that need to access the table data, SQL is often the better place to store it so those systems aren't reliant upon DriveWorks bridging between the systems.

The trade is setup and permissions. For a few dozen rows of configuration that only DriveWorks touches, a Group Table is less to maintain.

Changing a Simple Table's saved data

To change what a Simple Table holds permanently, edit the table in DriveWorks Administrator at design time. That is the supported route, and it is what "the project's original data" means in the sentence above.

Common questions

Why did the rows I wrote to a DriveWorks Simple Table disappear?

Runtime changes to a Simple Table persist only in the specification they run in. A new specification loads the table's original design-time data, so rows written earlier are not there.

How do I permanently add rows to a table from a DriveWorks form?

Write to a Group Table with the Update Group Table Using Array task, or to a SQL Server table. A Simple Table cannot be permanently changed at runtime.

What is the difference between a Simple Table and a Group Table in DriveWorks?

A Simple Table belongs to one project and holds data entered at design time. A Group Table belongs to the group, can be read by every project in that group, and can be updated at runtime by specification tasks.

Does Update Group Table Using Array insert or update?

Both. With control columns specified it overwrites a row whose control column values match and appends when there is no match. With the column names left blank it appends rows.

Base 10 Consultants is a DriveWorks Authorized Services Partner: CPQ configurators, design automation, and CAD-to-ERP integration for manufacturers.

Book a 30-minute call

Base 10 Consultants is a DriveWorks Authorized Services Partner and an independent company. This page is not written, reviewed, or endorsed by DriveWorks Ltd. DriveWorks is a trademark of DriveWorks Ltd; SOLIDWORKS is a trademark of Dassault Systèmes SolidWorks Corp. Behavior described here can differ between versions, so check the DriveWorks documentation for the version you run.