# Function: executeSyncFormula()

> **executeSyncFormula**(`packDef`, `syncFormulaName`, `params`, `context?`, `__namedParameters?`, `__namedParameters?`): `Promise`\<[`GenericSyncFormulaResult`](../../../core/type-aliases/GenericSyncFormulaResult/)>

Defined in: [testing/execution.ts:702](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/testing/execution.ts#L702)

Executes multiple iterations of a sync formula in a loop until there is no longer a `continuation` returned, aggregating each page of results and returning an array with results of all iterations combined and flattened.

NOTE: This currently runs all the iterations in a simple loop, which does not adequately simulate the fact that in a real execution environment each iteration will be run in a completely isolated environment, with absolutely no sharing of state or global variables between iterations.

For now, use `coda execute --vm` to simulate that level of isolation.

## Parameters

| Parameter | Type | | --- | --- | | `packDef` | [`BasicPackDefinition`](../../../core/type-aliases/BasicPackDefinition/) | | `syncFormulaName` | `string` | | `params` | [`ParamValues`](../../../core/type-aliases/ParamValues/)\<[`ParamDefs`](../../../core/type-aliases/ParamDefs/)> | | `context?` | [`SyncExecutionContext`](../../../core/interfaces/SyncExecutionContext/)\<[`Continuation`](../../../core/interfaces/Continuation/), [`Continuation`](../../../core/interfaces/Continuation/), [`Continuation`](../../../core/interfaces/Continuation/)> | | `__namedParameters?` | [`ExecuteOptions`](../../interfaces/ExecuteOptions/) | | `__namedParameters?` | [`ContextOptions`](../../interfaces/ContextOptions/) |

## Returns

`Promise`\<[`GenericSyncFormulaResult`](../../../core/type-aliases/GenericSyncFormulaResult/)>
