Set field values
fabrement-set-field-valuesFill the Fabrement fields of one record (post, page or CPT item) or of an options page. Keys of "values" are field names from get-fields; fields you do not send stay as they are; null clears a field back to its default. Every value is checked first (type, choices, dates YYYY-MM-DD / date-times YYYY-MM-DDTHH:MM in the site's time zone, no offset, number bounds, allowed post types, existing media/records, safe link addresses, required) and one bad value rejects the whole call, with the path of the value to fix. Value shapes: text/textarea/wysiwyg/date → string; select → the choice's value (not its label); number → number; true_false → boolean; icon → {key: one of its choices, e.g. "social/facebook", media: {} or {id: an uploaded image}}; image/file/post_object → attachment or post ID (0 = none); relationship → list of post IDs, gallery → list of image IDs (both ordered, at most 50); link → {url, label?, newTab?} or {postId, label? | useRecordTitle: true} (send label or useRecordTitle:true, or the link shows no words); group → {subName: value}; repeater → the COMPLETE list of rows [{_row?, subName: value}]. Keep the "_row" that get-field-values gives each existing row: it is the row's identity. A row without "_row" is new while other rows carry one; with no "_row" at all rows are matched by position. A stored row you leave out is deleted. When something changed, a record is saved as with its Update button (modified date, SEO, caches). No conflict check: the last save wins. Rules: get-skill-doc {id:"fields-contract"} — read it before the first call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| postId | No | ID of the post, page or CPT record. Send this OR options. | |
| values | Yes | field name => value. See the tool description for shapes. | |
| options | No | Slug of an options page (list-options-pages). Send this OR postId. | |
| valuesToken | No | Not used; leave it out. |