# expandRecordPickerAsync

**Kind:** Function

Expands a list of records in the Airtable UI, and prompts the user to pick
one. The selected record is returned to the extension, and the modal is
automatically closed.

If the user dismisses the modal, or another one is opened before this one
has been closed, it will return null.

Returns a promise that resolves to the record chosen by the user, or null.

```js
import {expandRecordPickerAsync} from '@airtable/blocks/ui';

async function pickRecordsAsync() {
    const recordA = await expandRecordPickerAsync([record1, record2, record3]);
    if (recordA !== null) {
        alert(recordA.name);
    } else {
        alert('no record picked');
    }

    const recordB = await expandRecordPickerAsync([record1, record2], {
        fields: [field1, field2],
    });
}
```

**Parameters:**
- `records` (`Array<Record>`) — the records the user can pick from. Duplicate records will be removed.
- `opts?` (`ExpandRecordPickerOpts`) — An optional options object.

**Returns:** `Promise<Record | null>`
