Skip to content

doc_type: example title: Click Driven Script Workflow summary: End-to-end Runline U example: run a multi-step workbook workflow from a click. product: u tags: - workflow - scripts - clicks use_case: Trigger a repeatable workbook automation sequence from a worksheet click audience: advanced


Click Driven Script Workflow

A workbook exposes a button-like cell that runs a controlled script: clear stale output, iterate through inputs, paste results, and log progress.

Files Used in This Example


Step 1: Define the Trigger

Use a click target as the user-owned command.

=U.SET_CLICKVALS("RUN SCRIPT",B2,1,0,"return(calc)",,,,C7)

Step 2: Create the Script

Store script steps in a visible range and register them with U.CREATE_SCRIPT.

=U.CREATE_SCRIPT(script_name,steps_range,log_range)

Step 3: Run on Click

Run only after the click event changes.

=IF(U.EVENT(U.GET_CLICKVAL(B2)),U.RUN_SCRIPT(script_name),U.CURRENT_VALS())

What’s happening here?

The script is visible in the workbook rather than hidden in an external macro. The click value and event check prevent ordinary recalculation from repeatedly running the workflow.