docs(skill): oldFields is top-level, not nested in record
E2E feedback: script following the documented 'record.oldFields.*'
nesting read undefined. Actual payload shape (verified in
workflow_execution.trigger_input + trigger node output):
triggerInput.oldFields = { fldXXX: value } at TOP level, sibling of
record. Align all trigger output docs (recordUpdated §2, recordCondition
§3, recordCreatedOrUpdated §4) + add explicit access examples
(triggerInput.oldFields?.['fldXXX'], {{n0.oldFields.fldXXX}}).
This commit is contained in:
@@ -61,10 +61,11 @@ inkreach-teable trigger set <wfId> --type recordUpdated --table-id tblXXX \
|
|||||||
- ⚠️ **Key is `fieldIds`, NOT `watchFieldIds`.**
|
- ⚠️ **Key is `fieldIds`, NOT `watchFieldIds`.**
|
||||||
- ⚠️ recordUpdated **ignores `conditions`** — use `recordCondition` if you need filtering.
|
- ⚠️ recordUpdated **ignores `conditions`** — use `recordCondition` if you need filtering.
|
||||||
|
|
||||||
**Output:** `record.id`, `record.fields.*` (post-update values), `record.oldFields.*` (pre-update values, field-ID keys), `user`, `tableId`, `changedFieldIds` (array of field IDs whose value changed).
|
**Output:** `record.id`, `record.fields.*` (post-update values), `oldFields.*` (pre-update values, field-ID keys), `user`, `tableId`, `changedFieldIds` (array of field IDs whose value changed).
|
||||||
|
|
||||||
**changedFieldIds / oldFields semantics** (delivered on both v1 and v2 API update paths):
|
**changedFieldIds / oldFields semantics** (delivered on both v1 and v2 API update paths):
|
||||||
- `oldFields` = full pre-update field snapshot keyed by field ID; `changedFieldIds` = deep-equal diff of before/after snapshots.
|
- `oldFields` = full pre-update field snapshot keyed by field ID; `changedFieldIds` = deep-equal diff of before/after snapshots.
|
||||||
|
- ⚠️ **`oldFields` is TOP-LEVEL** (`triggerInput.oldFields.fldXXX`), a sibling of `record` — NOT nested inside `record`. Script access: `triggerInput.oldFields?.['fldXXX']`; variable reference: `{{n0.oldFields.fldXXX}}`.
|
||||||
- `fieldIds` watch-filter matches against `changedFieldIds`.
|
- `fieldIds` watch-filter matches against `changedFieldIds`.
|
||||||
- On batch mode (`_batch`), each `records[]` entry carries its own `changedFieldIds` + `oldFields`.
|
- On batch mode (`_batch`), each `records[]` entry carries its own `changedFieldIds` + `oldFields`.
|
||||||
- ⚠️ **Fires on REST API record updates only** (`PATCH /api/table/{tableId}/record[/{recordId}]`, including programmatic/automation writes). Browser grid cell edits go through ShareDB ops and do **not** fire this trigger.
|
- ⚠️ **Fires on REST API record updates only** (`PATCH /api/table/{tableId}/record[/{recordId}]`, including programmatic/automation writes). Browser grid cell edits go through ShareDB ops and do **not** fire this trigger.
|
||||||
@@ -103,7 +104,7 @@ inkreach-teable trigger set <wfId> --type recordCondition --table-id tblXXX \
|
|||||||
```
|
```
|
||||||
Common operators: `is`, `isNot`, `isEmpty`, `isNotEmpty`, `isAnyOf`, `isNoneOf`, `contains`, `isGreater`, `isLess`, `isAfter`, `isBefore`.
|
Common operators: `is`, `isNot`, `isEmpty`, `isNotEmpty`, `isAnyOf`, `isNoneOf`, `contains`, `isGreater`, `isLess`, `isAfter`, `isBefore`.
|
||||||
|
|
||||||
**Output:** `record.id`, `record.fields.*`, `user`, `tableId`; on update events also `record.oldFields.*` + `changedFieldIds` (see §2 semantics).
|
**Output:** `record.id`, `record.fields.*`, `user`, `tableId`; on update events also top-level `oldFields.*` + `changedFieldIds` (see §2 semantics).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ inkreach-teable trigger set <wfId> --type recordCreatedOrUpdated --table-id tblX
|
|||||||
- Ignores `fieldIds` (watches all fields).
|
- Ignores `fieldIds` (watches all fields).
|
||||||
- `conditions` optional.
|
- `conditions` optional.
|
||||||
|
|
||||||
**Output:** same as recordCreated; on update events also `record.oldFields.*` + `changedFieldIds` (see §2 semantics).
|
**Output:** same as recordCreated; on update events also top-level `oldFields.*` + `changedFieldIds` (see §2 semantics).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user