pbi_patch_layout
Patch modified report layout into the PBIX archive, with forced close and save before overwriting to preserve unsaved changes.
Instructions
Patch the modified Report/Layout back into the PBIX archive.
When force=True the call closes (and if necessary kills) Power BI
Desktop so the PBIX can be overwritten. save_before_close (default
True) sends Ctrl+S to every running PBI Desktop window via
PostMessage before the kill, then waits up to 10 seconds for the
PBIX mtime to change. This flushes any in-memory TOM mutations
(measures, columns, role filters) that have not yet been persisted —
without this, those changes are lost when the process is killed.
The save attempt is best-effort: it never raises, and the layout patch
proceeds regardless of whether the save succeeded. The response
includes save_attempt with telemetry so the caller can detect
silent loss.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| pbix_path | Yes | ||
| extract_folder | Yes | ||
| include_hidden | No | ||
| save_before_close | No | ||
| fail_on_persistence_risk | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |