Set inputs
set_inputsWrite values or formulas into session cells and recalculate to run what-if scenarios; targets are overwritten, so commit first if you need undo.
Instructions
Write values or formulas into cells of a session and recalculate: the way to run a scenario on a model ("what if Revenue is 1.2M?"). Keys are defined names (e.g. "Revenue") or cell refs ("B4" on the active sheet, "Sheet1!A1"); values are numbers, booleans (logical TRUE/FALSE), error codes such as "#N/A", text, or a string starting with "=" to store a formula. Whatever the target cells held before is overwritten, so call commit_session first if you may want restore_session to undo it. The batch is all or nothing: a key that isn't a defined name or valid ref, or a formula that can't be stored, fails the call with invalid_input and no cell is written. Returns {applied, recalc, effects}: the cells written, recalc stats (with a warning for circular references that didn't converge) and each defined name whose value changed, with before and after. Read other results with get_outputs; to try a formula without touching the workbook use evaluate_formula; to create a name use define_variable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | Yes | Map of defined name or cell ref to value; a string starting with "=" is stored as a formula. Example: {"Revenue": 1000000, "Sheet1!B4": "=B2*1.1"} | |
| session_id | Yes | Session ID returned by create_session (list_sessions shows the open ones) |