# Import activities

Import activities into a Pristo CX population from an Excel or CSV file of up to 10,000 rows, and start event-based distributions for each contact.

In Pristo CX, you import activities (events) from an Excel (`.xlsx`) or CSV file in the **Population** tab, with **Actions** > **Import activities**. Each row becomes one activity of the event type you choose for the file, and active event-based distributions that select that event type send their questionnaire to the row's contact.

## Before you start

- Role: account admin or program admin. Program users cannot import. See [roles and permissions](https://docs.pristo.io/cx/users/roles-and-permissions).
- Plan: any plan except Free, where the population is not available. Event-based distributions appear under **Distributions** on the Pro plan.
- Setup: the event type, and any event attributes you want to import, defined in **Actions** > **Events attributes**. See [Populations overview](https://docs.pristo.io/cx/populations/overview#activities-and-event-types).
- File: one activity per row, with a contact identifier on every row. Use one file per event type.

> **Caution**
>
> Pristo CX records each imported activity at the time of the import, not at a date in your file, so old activities can still send questionnaires. To import past activities without sending anything, deactivate the event-based distributions that select the event type, and activate them again when every row is processed.

## Steps

![Sketch of the dialog that imports activities, open over the population page. Marker 3 is on the button that selects the file. Marker 4 is on the option for a file whose first row holds column names. Marker 5 is on the event type for every row. Marker 6 is on the contact column mapping, where you choose a column letter for each field. Marker 7 is on the event attribute mapping. Marker 8 is on the button that checks the file, at the bottom right.](https://docs.pristo.io/_astro/import-activities.Bw0iUGm9.webp)

1. Open the **Population** tab.

2. Select **Actions** > **Import activities**.

3. Select **Select file** and choose your file.

4. Keep **The file contains headers** selected if the first row holds column names. Clear it if the data starts on the first row.

5. Under **Event type**, choose the event type for every row in the file.

6. Under **Contact column mapping**, choose the column letter for **ID**, which is required. **Name**, **Last name**, **Email**, **Phone**, **Language** and your contact attributes are optional.

7. If the population has event attributes, choose their columns under **Event attributes column mapping**.

8. Select **Next**. Pristo CX checks the file without importing anything.

9. If the check passes, select **Import**. If it lists errors, select **Back**, fix the file or the mapping, and check again.

10. When **Import finished successfully** appears, select **Close**.

The dialog remembers the event type and the mapping, so the next import starts with the same choices.

## Result

The **Imports** tab adds a row of type **Activities**. Processing the activities can take a few minutes. The **Processed** column counts the rows done, and the list refreshes itself until every row is done.

For each row, Pristo CX adds the contact if the identifier is new, or updates the contact from the mapped columns, and lists the activity under **Events** on the contact's page. Every active [event-based distribution](https://docs.pristo.io/cx/distributions/event-based) that selects the event type then sends its questionnaire to the contact, if the contact passes its filters and rules.

## Import or API

| | Import activities | [Send an event](https://docs.pristo.io/cx/api/send-an-event) |
|---|---|---|
| Who reports it | An admin, in the app | Your own systems |
| How many | Up to 10,000 rows per file | One event per request |
| Event type | One per file, from the defined event types | Any event type key, per event |
| Plan | Any plan except Free | A plan with API access, Standard or Pro today. See [Plans and limits](https://docs.pristo.io/cx/get-started/plans-and-limits) |

Both ways update contacts in the same way, time the activity when Pristo CX receives it, and start the same distributions.

## Limits

- Files: `.xlsx` or `.csv`, up to 10 MB and 10,000 rows. Pristo CX reads only the first worksheet of an Excel file.
- Identifier: required, up to 50 characters. Rows can share an identifier: each row is its own activity, and later rows overwrite earlier contact details.
- Contact details follow the rules of [Import contacts](https://docs.pristo.io/cx/populations/import-contacts#limits). An empty cell keeps the current value. If the language column is not mapped, every contact in the file gets the population's default language.
- Event attribute values are imported as text, without a check against their type. A value that cannot be read as that type does not match a distribution filter.
- A file with any errors cannot be imported. The check stops listing errors after about 100.

## Troubleshooting

**The event type list is empty.** The population has no event types yet. Define them in **Actions** > **Events attributes** > **Event types**.

**The dialog says the file is invalid.** The message **Invalid file. Please select a valid xlsx or csv file up to 10MB** means the file is not `.xlsx` or `.csv`, or it is larger than 10 MB.

**The check shows Contacts that cannot be imported were found.** Each line names a row. The usual causes are an empty identifier and an identifier longer than 50 characters.

**No questionnaire was sent.** Wait until **Processed** shows every row. Then check that an active event-based distribution selects this event type, and see [Send surveys after events](https://docs.pristo.io/cx/distributions/event-based#troubleshooting).

## Related

- [Populations overview](https://docs.pristo.io/cx/populations/overview)
- [Import contacts](https://docs.pristo.io/cx/populations/import-contacts)
- [Send surveys after events](https://docs.pristo.io/cx/distributions/event-based)
- [Send an event](https://docs.pristo.io/cx/api/send-an-event)
- [Contact attributes](https://docs.pristo.io/cx/populations/contact-attributes)
