

# Data collection in Amazon Q Apps
Amazon Q Apps data collection

**Note**  
The Amazon Q Apps data collection feature is in preview and is subject to change.

A data collection app is an Amazon Q App with one or more form cards that collect multiple pieces of information from app users. For example, you might use a data collection app to conduct team surveys, organize project retrospectives, collect ideas for next year's goals, or collect questions for a town hall. These apps can leverage generative AI to analyze the collected data, identify common themes, summarize ideas, and provide actionable insights. 

When creating a data collection app, you add one or more data collection form cards. You can also add output cards that use generative AI to analyze or summarize participants' data. For each form card, you add one or more text input fields. For example, a user can submit an idea and the reason to prioritize. Forms can be configured to allow multiple submissions by the same user. For example, users can submit multiple ideas for next year's goals. 

After you share your app, you and other users can open it and start collecting data. When anyone opens the app and starts a data collection, they become a data collection owner. An owner can own only one active data collection per app. More than one user can start a data collection for the same app. The data collection owner shares the data collection with participants, controls access to the forms and data collection results, and controls when to start and stop accepting submissions.

 As the owner of a data collection, choose when reveal or hide the data from the form. For example, your app might collect ideas from the team for next year. Based on the collected data, you can choose to hold off on revealing the responses and any generative AI analysis or summaries. 

**Topics**
+ [

## Permissions requirements
](#qapps-forms-permissions)
+ [

# Data collection concepts
](qapps-forms-data-collection-concepts.md)
+ [

# Creating a new Q App with a data collection form
](qapps-forms-creating-app.md)
+ [

# Starting a new data collection
](qapps-forms-starting-new-data-collection.md)

## Permissions requirements


For users to create and use data collection apps, the web experience IAM role for your Amazon Q Business environment must have the following permissions for session resources:
+ qapps:GetQAppSessionMetadata
+ qapps:UpdateQAppSessionMetadata
+ qapps:ListQAppSessionData
+ qapps:ExportQAppSessionData

For more information, including a policy example, see [IAM permissions for using Amazon Q Apps](deploy-q-apps-iam-permissions.md).

# Data collection concepts


This topic outlines specific concepts and features of Data collection forms in Amazon Q Apps. These concepts are key to understanding how to collect data from users with Amazon Q Apps.

**Topics**
+ [

## Data collection
](#qapps-forms-data-collection)
+ [

## Data collection form
](#qapps-forms-data-collection-form)
+ [

## Creator
](#qapps-forms-creator)
+ [

## Data collection owner
](#qapps-forms-owner)
+ [

## User
](#qapps-forms-user)
+ [

## Shareable link
](#qapps-forms-shareable-link)
+ [

## Access control and security
](#qapps-forms-access-control-and-security)

## Data collection


A *data collection* is a pool of data that contains all participant responses submitted through the data collection form, as well as the configuration settings for how participants can access and submit data. Key aspects of data collections include the following:
+ Instantiation – After you publish your data collection app to the library, other users can open it and create a data collection. When a user creates a data collection, they become the data collection owner. Each owner has a unique shareable link they use control over which users participate. There can be multiple data collections for a single app.
+ Data isolation – Each data collection maintains its own separate pool of data. This ensures that each owner's data collection stays completely separate from any other owners' using the app.
+ Access control – The data collection owner creates and shares unique access links with participants.
+ Flexibility – Multiple owners can create data collections from the same data collection app. For example, you might have a Project Retrospective data collection app. Different owners can create new data collections for different projects from this same app.
+ Owner control – The owner manages access and data collection configuration.

## Data collection form


A *data collection form* is a unique Amazon Q Apps card type that allows you to collect multiple pieces of information from participating users. You can add up to 20 data collection form cards per app.

## Creator


A *creator* is the user who designs and builds the Q App with the data collection form. Creators have the ability to do the following:
+ Add data collection form cards.
+ Define the form's fields.
+ Set up and make changes to the overall structure of the Q App.
+ Initiate data collections (i.e., operate as the 'owner' of the data collection app) of the Q App tow collect data from different groups of users.
+ Can share, re-share, and unshare the Q App to and from the library.
+ Creators can be owners of a data collection associated with their own app.

## Data collection owner


An owner is a user who opens a data collection app and configures a new data collection with a shareable link. Owners control the data collection, including access and submission settings. They can own only one active data collection per app.

Key aspects of the Owner role include:
+ Data collection management – Owners control the data collection, including when to start and stop accepting responses.
+ Access control – Owners manage who can by access the data collection by sharing the link located in the data collection settings.
+ Advanced settings – Owners can use the data collection's advanced settings to allow users to submit data or see all collected data. This is important when the data collection is being used for sensitive information (e.g., personal identifying information (PII)). For more information, see [Access control and security](#qapps-forms-access-control-and-security).
+ Limited app editing capabilities – They can't make structural changes to the core data collection app (i.e., add, edit, and remove cards).

## User


A user accesses a shared data collection app via the unique data collection link provided by the owner to submit data. Key aspects of the user role include –
+ Response submission – users can fill out and submit data using a form within the data collection.
+ Limited access – users cannot modify the form structure or manage data collection data collection settings.
+ Viewing data – Depending on controlled data collection settings, users may or may not be able to view other users' submissions.
+ Multiple submissions – users may be able to submit multiple inputs, based on the form's configuration.

## Shareable link


A shareable link is a unique URL that provides access to a specific data collection app. Owners share this link with intended participants over a channel of their preference, such as email or slack. Key features of shareable links include:
+ Access control – Links are private and can only be accessed by users within the organization's Q Instance.
+ Data collection-specific – Each link corresponds to a particular data collection of the Q App.
+ Security – Links may have additional security measures, such as expiration dates or user authentication requirements.

## Access control and security


The Data collection owner controls who can submit data and who can view the collected data.

**Topics**
+ [

### Data access
](#qapps-forms-data-access)
+ [

### Data visibility
](#qapps-forms-data-visibility)
+ [

### Multiple submissions
](#qapps-forms-multiple-submissions)
+ [

### Limitations
](#qapps-forms-limitations)
+ [

### Security
](#qapps-forms-security)

### Data access


By default, the shareable data collection link allows anyone within your organization to submit data. As the owner, you can choose to:
+ Leave the data collection open for unlimited submissions.
+ Disable submissions at any time.

### Data visibility


The visibility of submitted data is also controlled by the owner. By default, all users can view the collected data. You can choose to hide results and only reveal them when you're ready to review the data.

This flexibility allows you to control the data collection form process – whether you want it to be an open, transparent exercise or a more controlled, private exercise. The owner maintains full control over the data collection settings and data access. Users can only submit data through the shared data collection link and view data based on the owner's permissions.

### Multiple submissions


By default, data collection forms limit users to one response. When you add a data collection form, you can clear the **Limit users to one response** check box to allow for multiple submissions from each user within a data collection. If a user submits a form multiple times in the same data collection, all of their submissions are be saved. If you use a single submission form, only the recent submission is saved.

### Limitations


The following are limitations for data collection apps

1. Isolated data usage – The collected data is confined to the Q App where they're created. You cannot combine them with other data sources or use different card output types within the same app.

1. Optional form fields – By default, form fields aren't required. Users can submit forms without completing all fields, potentially resulting in incomplete data.

1. Number of data collection cards:Creators can add up to 20 data collection form cards to a single Q App.

### Security


All data collected through Amazon Q Apps data collection form are stored securely within your organization's Q Instance and are not accessible to anyone outside your organization.

# Creating a new Q App with a data collection form


To create a new data collection app, you create a new app, add a data collection form with one or more fields, and publish the app.

1. Go to your Amazon Q Business web experience URL.

1. In the navigation pane, choose **Apps**.

1. Choose one of four methods to start creating your Q App data collection form:
   + In **Recently used** choose the pencil icon.
   + Choose a tile that contains a **Data collection** pill
   + Describe your Q App data collection form use case in the text entry box and choose **Generate**.
   + Choose **Create blank app**
   + Choose **Explore the Q Apps library** to start with any existing apps your team may have already created and shared.

1. Choose **\$1 Add card** and choose **Data collection form**.

1. Choose the pencil icon on the data collection form.

1. For **Title**, give the form a name.

1. Under **Fields**, add one or more fields with field labels.
   + Choose **\$1 Add a field** to add more fields.
   + Choose the trash can icon to delete a field.

1. Choose **Save** to save the form.

1. Add any necessary output cards to analyze the collected data. Use `@cardname` to reference the data from the form card in the prompt. 

1. When you are finished, the top right, choose **Share**.

1. Configure how you want to share the app and optionally edit its categories.

1. Choose **Share**. When complete, you can find the new app in your library.

# Starting a new data collection


You can start a new data collection with the web experience or with the Q Apps APIs.

## Web experience


To start a new data collection, you open an app with a data collection form, configure data collection settings, and then copy and share the link to start collecting responses.

1. Go to your Amazon Q Business web experience URL.

1. In the navigation pane, choose **Apps**.

1. Locate and open an existing Q App that has a data collection form.

1. Choose **Start data collection** at the top right.

1. Enter a name for the data collection. For example, John Doe's All-Hands Meeting. You use this name when you reference the data from the form in other cards. For example, outputting an AI-generated summary of responses to an output card in the app. 

1. In **Advanced settings**, configure the participant experience with the **Allow users to submit data** and **Allow users to see all collected data** check boxes. 

1. Choose **Create**.

1. Choose the options to enable/disable form submissions and whether users can see others' data.

1. Choose the **Copy** icon to obtain the shareable link.

1. Choose **Save**.

1. Share the link directly with your users. As users respond to questions, you can do the following from your app:
   + To see user data, on the form collection card, choose **All data**.
   + To delete collected data, choose **Data collection settings** and choose **Delete collected data**.
   + To stop or restart collecting data, toggle the **Allow users to submit data** check box.

## Q Apps APIs


Owners can start and manage data collections with the following APIs:
+ `StartQAppSession` - Start a new data collection.
+ `UpdateQAppSessionMetadata` - Update metadata for the data collection. For example, give the collection a name.
+ `UpdateQAppSession` - Optionally provide answers to your own data collection questions.
+ `ListQppSessionData` - List all submitted values for form cards.
+ `ExportQAppSessionData` - Export data in CSV format
+ `StopQAppSession` - Terminate the session

For participants, use the following APIs:
+ `StartQAppSession` - Associate the user with the data collection.
+ `GetQAppSession` - Get the latest state of the data collection. Use this API before and after submitting data into form cards.
+ `ListQAppSessionData` - Get all submitted values for form cards.
+ `UpdateQappSession` - Submit data into form cards.