# Interface: ObjectArrayFormulaDef\<ParamsT, SchemaT>

Defined in: [api.ts:1009](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api.ts#L1009)

Inputs to declaratively define a formula that returns a list of objects. That is, a formula that doesn't require code, which like an [EmptyFormulaDef](../EmptyFormulaDef/) uses a [RequestHandlerTemplate](../RequestHandlerTemplate/) to describe the request to be made, but also includes a [ResponseHandlerTemplate](../ResponseHandlerTemplate/) to describe the schema of the returned objects. These take the place of implementing a JavaScript `execute` function.

This type is generally not used directly, but describes the inputs to [makeTranslateObjectFormula](../../functions/makeTranslateObjectFormula/).

## Extends

- `Omit`\<[`PackFormulaDef`](../PackFormulaDef/)\<`ParamsT`, [`SchemaType`](../../type-aliases/SchemaType/)\<`SchemaT`>>, `"execute"`>

## Type Parameters

| Type Parameter | | --- | | `ParamsT` *extends* [`ParamDefs`](../../type-aliases/ParamDefs/) | | `SchemaT` *extends* [`Schema`](../../type-aliases/Schema/) |

## Properties

### cacheTtlSecs?

> `readonly` `optional` **cacheTtlSecs**: `number`

Defined in: [api_types.ts:593](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L593)

How long formulas running with the same values should cache their results for.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`cacheTtlSecs`](../SyncFormulaDef/#cachettlsecs)

______________________________________________________________________

### connectionRequirement?

> `readonly` `optional` **connectionRequirement**: [`ConnectionRequirement`](../../enumerations/ConnectionRequirement/)

Defined in: [api_types.ts:585](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L585)

Does this formula require a connection (aka an account)?

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`connectionRequirement`](../SyncFormulaDef/#connectionrequirement)

______________________________________________________________________

### description

> `readonly` **description**: `string`

Defined in: [api_types.ts:554](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L554)

A brief description of what the formula does.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`description`](../SyncFormulaDef/#description)

______________________________________________________________________

### examples?

> `readonly` `optional` **examples**: `object`[]

Defined in: [api_types.ts:574](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L574)

Sample inputs and outputs demonstrating usage of this formula.

#### params

> **params**: ([`PackFormulaValue`](../../type-aliases/PackFormulaValue/) | `undefined`)[]

#### result

> **result**: [`PackFormulaResult`](../../type-aliases/PackFormulaResult/)

#### Inherited from

`Omit.examples`

______________________________________________________________________

### extraOAuthScopes?

> `readonly` `optional` **extraOAuthScopes**: `string`[]

Defined in: [api_types.ts:621](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L621)

OAuth scopes that the formula needs that weren't requested in the pack's overall authentication config. For example, a Slack pack can have one formula that needs admin privileges, but non-admins can use the bulk of the pack without those privileges. The platform will give users help in understanding that they need additional authentication to use a formula with extra OAuth scopes. Note that these scopes will always be requested in addition to the default scopes for the pack, so an end user must have both sets of permissions.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`extraOAuthScopes`](../SyncFormulaDef/#extraoauthscopes)

______________________________________________________________________

### instructions?

> `readonly` `optional` **instructions**: `string`

Defined in: [api_types.ts:559](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L559)

Instructions for LLMs to use the formula, overrides the description for LLMs if set.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`instructions`](../SyncFormulaDef/#instructions)

______________________________________________________________________

### isAction?

> `readonly` `optional` **isAction**: `boolean`

Defined in: [api_types.ts:580](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L580)

Does this formula take an action (vs retrieve data or make a calculation)? Actions are presented as buttons in the Coda UI.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`isAction`](../SyncFormulaDef/#isaction)

______________________________________________________________________

### isExperimental?

> `readonly` `optional` **isExperimental**: `boolean`

Defined in: [api_types.ts:599](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L599)

If specified, the formula will not be suggested to users in the formula autocomplete. The formula can still be invoked by manually typing its full name.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`isExperimental`](../SyncFormulaDef/#isexperimental)

______________________________________________________________________

### isSystem?

> `readonly` `optional` **isSystem**: `boolean`

Defined in: [api_types.ts:605](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L605)

Whether this is a formula that will be used internally and not exposed directly to users. Not for use by packs that are not Superhuman-authored.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`isSystem`](../SyncFormulaDef/#issystem)

______________________________________________________________________

### name

> `readonly` **name**: `string`

Defined in: [api_types.ts:549](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L549)

The name of the formula, used to invoke it.

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`name`](../SyncFormulaDef/#name)

______________________________________________________________________

### ~~network?~~

> `readonly` `optional` **network**: [`Network`](../Network/)

Defined in: [api_types.ts:588](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L588)

#### Deprecated

use `isAction` and `connectionRequirement` instead

#### Inherited from

[`SyncFormulaDef`](../SyncFormulaDef/).[`network`](../SyncFormulaDef/#network)

______________________________________________________________________

### parameters

> `readonly` **parameters**: `ParamsT`

Defined in: [api_types.ts:564](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L564)

The parameter inputs to the formula, if any.

#### Inherited from

`Omit.parameters`

______________________________________________________________________

### request

> **request**: [`RequestHandlerTemplate`](../RequestHandlerTemplate/)

Defined in: [api.ts:1012](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api.ts#L1012)

A definition of the request and any parameter transformations to make in order to implement this formula.

______________________________________________________________________

### response

> **response**: [`ResponseHandlerTemplate`](../ResponseHandlerTemplate/)\<`SchemaT`>

Defined in: [api.ts:1014](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api.ts#L1014)

A definition of the schema for the object list returned by this function.

______________________________________________________________________

### validateParameters?

> `optional` **validateParameters**: [`MetadataFormula`](../../type-aliases/MetadataFormula/)\<[`ExecutionContext`](../ExecutionContext/), [`ParameterValidationResult`](../../type-aliases/ParameterValidationResult/)>

Defined in: [api_types.ts:665](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L665)

The JavaScript function that implements parameter validation. This is only allowed on sync formulas.

This function takes in parameters and a context containing a [PermissionSyncMode](../../enumerations/PermissionSyncMode/) and validates the parameters. A formula may want to validate parameters differently for permissionSyncMode 'PermissionAware' vs 'Personal' vs undefined (which represents a formula).

#### Example

```
validateParameters: async function (context, _, params) {
  let {quantity, sku} = ensureExists(params);
  let errors = [];
  if (quantity < 0) {
    errors.push({message: "Must be a positive number.", propertyName: "quantity"});
  }
  if (!isValidSku(context, sku)) {
    errors.push({message: `Product SKU not found.`, propertyName: "sku"});
  }
  if (errors.length > 0) {
    return {
      isValid: false,
      message: "Invalid parameter values.",
      errors,
    };
  }
  return {
    isValid: true,
  };
},
```

#### Returns

a [ParameterValidationResult](../../type-aliases/ParameterValidationResult/)

#### Inherited from

`Omit.validateParameters`

______________________________________________________________________

### varargParameters?

> `readonly` `optional` **varargParameters**: [`ParamDefs`](../../type-aliases/ParamDefs/)

Defined in: [api_types.ts:569](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L569)

Variable argument parameters, used if this formula should accept arbitrary numbers of inputs.

#### Inherited from

`Omit.varargParameters`
