# ~~Function: executeSyncFormulaFromPackDef()~~

> **executeSyncFormulaFromPackDef**(`packDef`, `syncFormulaName`, `params`, `context?`, `__namedParameters?`, `__namedParameters?`): `Promise`\<`ObjectSchemaDefinitionType`\<`any`, `any`, `any`>[]>

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

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.

## Deprecated

Use [executeSyncFormula](../executeSyncFormula/) instead.

## 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`\<`ObjectSchemaDefinitionType`\<`any`, `any`, `any`>[]>
