---
title: Preview a transaction
summary: Write BUL statements as a transaction in the Actions tree and see, before you commit, which objects each statement selects and which of them will change, coloured in the 3D viewer.
order: 53
since: 3.0
terms: [bul, transaction, version, action]
requires: [PREDEFINED_QUERIES, BUL]
see-also: [how-to/using-bimworks/edit-a-model, how-to/models/change-a-model-with-bul, reference/bul, how-to/using-bimworks/use-the-actions-tree]
---

# Preview a transaction

A [[term:transaction]] written by hand — a fire rating for every wall of a storey, a classification, objects to delete — can be checked before it changes anything. *Preview* works the statements out against the loaded models without committing them, colours in the 3D viewer what each one selects and what it would change, and counts it per statement. Nothing is written until you commit, and closing the preview gives the model back as it was.

## Before you start

- Load the models the transaction is for: the statements are worked out against every loaded model.
- The **Actions** tab with transactions needs [[feature:PREDEFINED_QUERIES]] and [[feature:BUL]].

## Steps

1. In the **Actions** tab, add a *Transaction* to a folder, or open one.
2. Write the statements in [[term:bul|BUL]]: `SET` and `DEL` for values, `DELETE OBJECT` and `TRANSFORM` for objects, each with its own `WHERE` ([[page:reference/bul#statements]]).
3. Press **Preview**, or **F5**. The viewer colours the objects and a strip under the code lists the statements.
4. Click a statement in the strip to see it alone, or put the cursor in it. *All statements* shows them together again.
5. Commit with *Commit…* in the strip or in the menu of the *Preview* button, or close the preview with its **✕**.

## What the colours mean {#colours}

| Colour | The objects |
|---|---|
| Blue | will change: the statement writes a value they do not have yet |
| Yellow | will move (`TRANSFORM`), including objects placed relative to a moved one |
| Red | will be deleted (`DELETE OBJECT`) |
| Light grey | are selected by the `WHERE` but already have the value, so they stay as they are |
| See-through | are not selected by the statements in view |

These are the colours of [[page:how-to/using-bimworks/compare-versions|comparing versions]]: the preview looks like the comparison you will see after committing. The legend under the strip and in the bar over the viewer names each colour with its count; its fit button turns the view to those objects.

## The strip {#strip}

Per statement, *matched* is how many objects its `WHERE` selects and *will change* how many of them end up different. A 0 in orange is a statement that changes nothing. The header names the model and the version a commit creates, `v3 → v4`, and a problem that blocks the commit, such as a model that is not its newest version.

With **Auto update** ticked the preview follows your typing: it runs again once you pause, for code without errors. Without it, an edit marks the strip *Out of date · F5*. A statement the server refuses shows the reason in red, and the last preview stays.

The bar over the viewer steps through the statements with its arrows, and its *Close* gives the model back as it was. Showing something else in the viewer, such as a check, ends the preview there; click a statement in the strip to show it again.

## Limits

- *Will change* is per statement: a statement that undoes an earlier one counts both as changes.
- In the WebGPU viewer a `TRANSFORM` with a `PIVOT` (or only a `MOVE`) shows the objects where they will go, with a ghost where they are. In the WebGL viewer, and for a turn about each object's own origin or a `LOCAL_AXIS`, the colour alone says they move.
- Objects the view does not show, such as hidden spaces or type objects, are counted in the legend but not coloured.
- A model with more than 100,000 objects in the transaction shows its counts only.
- *Commit…* closes the preview first: the commit makes a new version and the viewer switches to it.

## Check

Preview `SET attribute.Description = "Checked" WHERE type = IFCDOOR` twice in one transaction: the first statement colours the doors blue, the second, on its own, grey with *will change* 0.

From code, a dry run with `include_oids` returns the same objects per statement ([[page:how-to/models/change-a-model-with-bul#objects]]).
