Modifiers
A Modifier takes the text of an Extract (or of another Modifier) and gives new text. Modifiers sit between an Extract and its Validators: the Extract reads, the Modifiers change the text one after another, and the Validators check the result. The most common use is removing a field's label, so that only the value is checked.
Modifier types
| Modifier | Settings | Gives |
|---|---|---|
| Remove text | Text to remove (the first occurrence of each): one or more pieces (Add text, Another text). | The text with the first occurrence of each piece removed, piece by piece in the order listed. |
| Replace text | Replace and with. | The text with the first occurrence of Replace replaced by with. An empty Replace changes nothing. |
| Keep the first N characters | Keep the first N characters. | The first N characters. |
| Keep the last N characters | Keep the last N characters. | The last N characters. |
In the Add ▾ menu the last two are listed as Modifier: Keep the first characters and Modifier: Keep the last characters.
Rules that apply to all of them:
- Upper and lower case matter. Remove text with
Clientdoes not removeCLIENT. - Text is taken literally. Characters such as
*,.or$have no special meaning. - Only the first occurrence is removed or replaced. To remove a text that appears twice, add the piece twice.
- Spaces count as characters, for Keep the first / last N characters as well.
- Spaces at the ends of a piece: the guided setup's Remove text… form removes them from what you type; the Modifier's own editor keeps a piece exactly as typed.
Every Modifier also has a Name (optional), Changes the text of (what it reads; not shown inside a field validation, where the chain decides), and a preview of what it Gives on the template.
Examples
| Extract reads | Modifier | Gives |
|---|---|---|
CLIENTEXAMPLE CLIENT | Remove text: CLIENT | EXAMPLE CLIENT |
SCALE1:200 @ A3 | Remove text: SCALE | 1:200 @ A3 |
REV:P02 | Remove text: REV: | P02 |
1-200 | Replace text: - with : | 1:200 |
NDXTEST-NHX-B1-00-DR-A-200100 | Keep the last 6 characters | 200100 |
NDXTEST-NHX-B1-00-DR-A-200100 | Keep the first 7 characters | NDXTEST |
The first example shows why the first occurrence matters: the label CLIENT comes first, so it is removed and the CLIENT in the value stays.
Every field of the "Title block" data frame has a Remove text Modifier for its label (CLIENT, PROJECT, SCALE, DATE, JOB No., Originator, Role), so the Validators check only the values.
The order Modifiers apply in
The Modifiers of a chain apply one after another, each to the text the previous one gives. The order can change the result:
| Text | First | Then | Result |
|---|---|---|---|
DRG-0042 | Remove text DRG- | Keep the first 2 characters | 00 |
DRG-0042 | Keep the first 2 characters | Remove text DRG- | DR |
Changing the order:
- In the guided field validation's step Check the value, the changes are listed numbered, in the order they apply, with ↑ (Apply earlier) and ↓ (Apply later).
- On the document type page, expand the field validation and drag the Modifier cards.
The step Check the value shows the value as the checks will see it, so you can confirm the result before adding checks.
Removing text by clicking it on the drawing
In the canvas editor and in the guided field validation, hover a text item of the selected field and choose Remove from value. The piece becomes part of the chain's Remove text Modifier (one is added after the Extract if the chain has none), and Put back takes it out again. See Canvas editor › Removing text pieces from the drawing.
A clicked text item is removed as one piece, as it is stored in the PDF (without spaces at its ends). If the label and the value are one text item (for example REV: P02), clicking removes both. Use Remove text… and type the label instead.
Adding a Modifier
- Guided field validation, step Check the value: Remove text…, Replace text…, Keep the first N characters or Keep the last N characters, each a small form.
- On the document type page, in an expanded group: hover a value block and click the round + on its corner to insert a Modifier after it.
- Add ▾ › Modifier: … in the Items section adds a loose Modifier. Choose what it reads in Changes the text of.
Deleting a Modifier
Deleting a Modifier takes it out of its chain and keeps the chain connected: whatever read the Modifier now reads what the Modifier read. For example, in the chain Extract → Remove text → Keep the first 6 characters → Fixed value, deleting the Remove text leaves Extract → Keep the first 6 characters → Fixed value.
- From a card's bin in an expanded group, a Modifier is deleted at once, without a question.
- In the guided setup, × next to a change removes it.
- Cancel in the guided setup removes everything the setup made, Modifiers included.
Deleting an Extract works differently: what reads it loses its source (see Extracts).
Related pages
- Extracts: what a Modifier reads.
- Validators: what checks the result.
- Field validation: the guided setup step by step.