apply_report_operations
Apply atomic batches of operations to SAS Visual Analytics reports: add pages, objects, set parameters, and change data sources with validation.
Instructions
Apply an ordered batch of operations to a report — the authoring workhorse.
This is how you add pages, add objects (any of the ~60 VA visual, control,
and content types), set parameters, and swap data sources. operations
is the native SAS Visual Analytics operations array; the whole batch is
applied atomically (all succeed or nothing changes).
Operation keys (one per array element): addData, addPage,
addObject, updateObject, setParameterValue, updateData,
changeData, applyDataView. Call describe_report_objects for
each operation's shape (operation="addData" covers formats,
aggregations, and geography via dataItems) and each object's data
roles, and get_castable_columns to map columns onto those roles.
Layout & titles (see describe_report_objects → placement /
layout_recipes for details):
Page title — give
addPageatitle(e.g.{"addPage": {"pageName": "Overview", "title": "Sales Overview"}}); it becomes a text band at the top of that page's body. Page/report headers accept ONLY control objects — never text or visuals.Chart titles — pass
{"options": {"object": {"title": "..."}}}inside the object spec at add time (all types exceptstandardContainer, which takes no options at add time).One-batch multi-page — create pages inline with placement
{"report": {"context": "new_page", "pageName": "Trends", "pagePosition": 1}}(numeric position) and target that pageName from later operations in the same batch.Grids/columns —
relativeToObjectwithleft/right/top/bottom(geometric) orbefore/after(flow order) against an EXISTING object's name; same-batch forward references fail, so chain across calls using the names each result returns. Objects are auto-named and auto-sized; placement and dataRoles are write-once (updateObjectchanges options only).Read structure back anytime with
get_report_outline; verify visually withexport_reportpage-by-page (seeverify_hintin the result).
The tool validates every operation against the object catalog before any HTTP call (unknown/typo'd object type, non-addable object, bad data-role names or arity, disallowed object/placement keys) and reports ALL invalid operations at once. It also handles the ETag optimistic-concurrency handshake for you, retrying once transparently on a concurrent edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Validate and return the normalized payload (plus any soft warnings about missing common roles) without writing anything. | |
| report_id | Yes | Target report id (from ``create_report`` or ``list_reports``). | |
| operations | Yes | Ordered native operations array. Example element: ``{"addObject": {"object": {"barChart": {"dataSource": "CARS", "dataRoles": {"category": "Origin", "measures": ["MSRP"]}, "options": {"object": {"title": "MSRP by Origin"}}}}, "placement": {"page": {"target": "Overview"}}}}``. | |
| result_folder | No | Save-as target folder URI; omit for My Folder. | |
| response_format | No | ``concise`` (default) returns the created page/object/ data-source names+labels; ``detailed`` also echoes the full VA response. | concise |
| result_report_name | No | Save-as — apply the operations to a NEW report with this name, leaving the source report untouched (atomic template instantiation; pairs with ``changeData``). | |
| result_name_conflict | No | Save-as name-conflict policy — ``rename`` (default), ``abort``, or ``replace``. | rename |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||