Omniscope Custom Views › switchparamandexecute

Switch Param and Execute Workflow

Pick a value, and the workflow re-runs with it: a parameter switch for reports built by a parameterised workflow.

Tool

Open the demo in Omniscope Download demo.ioz Sample data: orders.csv Source on GitHub

Pick a value, and the workflow re-runs with it: a parameter switch for reports built by a parameterised workflow.

Live: pick a region. The view sets the project parameter Region, then executes the Report block; here the Workflow REST API is simulated.

The problem it solves

When a report's data comes from a workflow driven by a parameter (a region in a database query, a scenario in a model), changing the parameter is only half the job: the workflow must then run again before the report changes.

The Switch Param and Execute Workflow view does both on one click: it sets the parameter to the value picked, then executes the blocks you name and follows the job. Above, an illustrative Region parameter and a Report block.

Where it earns its place

The examples below are illustrative.

Team Switch
Sales A region switch on a dashboard fed by a parameterised database query
Finance Budget scenarios computed by a model block
Operations The depot whose live orders are loaded from an API

How to use it in Omniscope

  1. Create the project parameter and use it in blocks (a filter, a query, a formula).
  2. Give the users who should switch it the Project parameters access via APIs and Workflow Execution via APIs permissions.
  3. Connect a source listing every value (for example the unfiltered data) to the report.
  4. Add a view, choose Switch Param and Execute Workflow, and set Parameter name, Values from and Blocks to execute.
  5. Turn Refresh from source off if only a filter or formula uses the parameter: the re-run is then quicker.

Why do this in Omniscope

Data and options

A field with the values to offer.

Option What it does
Parameter name The project parameter to set
Values from The field whose values are offered
Blocks to execute Block names; empty runs the whole workflow
Refresh from source Reload from the sources, or reuse loaded data
Most values shown Limit on the list (default 10)
Show job state Show the job's progress

Tested

Mock harness with a stand-in for the Workflow REST API: the current value ticked on opening; a click sends the update and then one execution of the named blocks, with the values disabled until the job has finished; a number parameter set to a number, and opening, filtering or resizing never sends an update or an execution; clicking the current value sends nothing; a refused update keeps the previous value and executes nothing; an unknown parameter is reported; filtering; a 120 by 70 pane; empty data; no settings; and 3,000 values (the first 10 shown); and a reload of the view in the middle of a run (the view resumes and shows the result).

Reference

Fields it reads

NameTypeWhat it does
Values fromGROUPINGField whose distinct values become the choices. Use a data source with every value, so the choices do not depend on the parameter itself.

Options

NameTypeWhat it does
Blocks to executeTEXTNames of the workflow blocks to execute, separated by commas, e.g. Load orders, Report. Leave empty to execute the whole workflow.
Parameter nameTEXTName of the project parameter to set, exactly as in the workflow's parameters.
Refresh from sourceTOGGLEOn: the blocks reload their data from the sources. Off: data already loaded upstream is reused where possible.
Most values shownNUMBERShow at most this many values (default 10).
Show job stateTOGGLEShow the execution's progress (queued, running, finished) under the values. Errors are always shown.