All articles

Working with Buddy

Fix the issues Weft flags

Some mistakes do not stop a template rendering; they print blank. A mistyped field prints nothing, and a table pointed at the wrong list prints no rows. As you work, Weft checks your template against the data you have loaded and flags each problem it is sure of.

Before you start

  • In the hosted app, changing a template needs the editor role or higher (roles run viewer, editor, admin, owner). Local mode — one person, documents kept in the browser — has no roles.
  • Load data from the data pill, the button above your document that names the data you are previewing. Fields are judged against the records you have loaded; in the hosted app, a saved template with a data source is also checked against that source's fields. With neither, fields are not checked.
  • Notices appear in the Flow view only. The Paged view hides them, and so does a proposal from Buddy while it waits for review.

Read a notice

Each problem shows in two places:

  • On the canvas, as a dashed line under the block or table cell: amber for a field or list problem, red for a setting Weft cannot render. A Repeat element draws nothing of its own on the canvas, so its notice is a card only, as is a document-wide problem.
  • In the dock at the bottom left of the canvas, headed with a count such as "3 things to check", with one card per problem.
The document on the canvas, with a heading underlined by an amber dashed line. Over its lower left, a dock headed 1 thing to check holds a card titled This field won't resolve, with a Use record.Client.Company button and an Ask Buddy to fix button.

In the Outline panel, a heading, paragraph, table or repeat whose field or list will not resolve also carries a ⚠.

NoticeWhat it means
This field won't resolveA field's path leads to nothing in the loaded data — often a typo, or a field that belongs to a different record
This list won't resolveA table's or repeat's list path, or the list a total adds up, leads to nothing in the loaded data, often a typo
This isn't a listA table's or repeat's list path, or the list a total adds up, leads to a single value, not a list of rows
This condition won't resolveA field in a condition leads to nothing: a Show only when condition, a styling rule, a Conditional element, a column's condition or the watermark's. The condition reads the field as empty, so content can show or hide for the wrong reason
This formula won't resolveA field part of a formula leads to nothing, so the formula prints nothing
This total won't resolveA total's field leads to nothing for the rows of the list it adds up
This barcode's field won't resolveA barcode's Value path leads to nothing, so the barcode has nothing to encode
This field renders empty hereA field of one row sits in a table's footer, group header or subtotal, which print once for the whole table or group; use a total or a field of the whole record instead
No preview data yetA saved template opened with no preview data in this browser, so its fields show empty. One notice for the whole template, in place of one on every field; load data from the data pill (see Manage templates)
This block needs a fixA setting in this block that Weft cannot render as it stands; the message says which
This document needs a fixThe same, for a document-wide setting

Go to the block

Click a card's text (tooltip "Show on the canvas") to select its block; the canvas scrolls to it. Clicking a dashed line works the other way round: it selects the block and highlights its card (open the dock first if you collapsed it). A This document needs a fix or No preview data yet card has no block to select.

To fix it by hand, open the properties panel (⌘., or Ctrl+. on Windows) and point the field or list at the right name — see Bind fields. The notice disappears as soon as the problem is gone.

Collapse the dock

Click the dock's heading (tooltip "Collapse — the count stays") to fold it down to the count. Click it again (tooltip "Show what needs checking") to open it. Weft remembers the choice in this browser. When nothing is left to check, the dock disappears.

Apply a one-click correction

When a mistyped field is close to one that exists in your data, its card offers a button reading Use followed by that field's name. Press it to point the field there in one step; Undo reverses it. The suggestion is only the nearest name, so check it is the field you meant.

This correction works for a field in a heading, a paragraph, a cell of a table's ordinary rows, a table's footer or column header, or a group header or subtotal; for a barcode's Value path; and for the list a table or repeat reads, where it offers only lists. Fields in a list item, a sub-row or a section title, formulas, totals and conditions get no button. Correct those in the properties panel.

Ask Buddy to fix it

Buddy is the assistant built into Weft. Every notice about a block offers Ask Buddy to fix, which hands that one problem to Buddy. In local mode this needs the designer to reach the AI service.

  1. Press Ask Buddy to fix on the card. It reads Asking Buddy… while Buddy works, and the status chip beside Generate in the app bar reads "Buddy is fixing this…" next to Stop.
  2. Buddy receives your document as it is in the editor, the notice and your loaded data. It is asked to fix only that problem with the smallest change, to leave everything else as it was, and to bind only to fields that exist in your data.
  3. The answer arrives as a proposal: the canvas shows the proposed document, read-only, under a review bar headed Proposed fix, with each changed block tagged Changed.
  4. Press Accept all to take it, or Discard to keep your document as it was. When the fix only changes existing blocks, each change also has its own Reject button — see Review proposed changes.

Weft works on one fix at a time: until the answer arrives, Ask Buddy to fix on the other cards is unavailable, and its tooltip says why. Stop cancels the request. If Buddy cannot produce a valid fix, a message titled Edit not applied says why. Either way your document is unchanged.

Once accepted, the fix is listed in the activity feed (open it from the status chip) as "Before fixing:" followed by the notice's title, with a Rewind button.

Good to know

  • The check behind the PDF button lists the notices again as problems, shown in red whatever their colour on the canvas, and asks before rendering. It leaves out notices about content that will not print for the loaded data, such as the unused blocks of a Conditional element — see Check before export.
  • A field missing from the sample you are previewing is flagged even if your real records have it. Switch samples under Preview shape in the data pill or, in the hosted app, press Use live data there, to check.
  • A field of one row, inside a table or repeat whose list is empty in the sample, is not judged: Weft cannot tell a typo from an empty list.
  • Notices cover fields in headings, paragraphs, lists, section titles and tables — including on covers, headers and footers — the lists that tables and repeats read, formulas, totals, barcode fields, and the fields inside conditions.

What next