# Quickstart - train and get model

> The purpose of this guide is to help you create a working sample that uses the following Azure Form Recognizer activities:

## Overview

The purpose of this guide is to help you create a working sample that uses the following Azure Form Recognizer activities:

* [Train Model](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-train-model#train-model)
* [Get Model Info](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-get-model-info#get-model-info)
* [Get Model Keys](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-get-model-keys#get-model-keys)
* [Delete Model](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-delete-model#delete-model)

This working sample enables you to quickly verify the connection to your Azure Form Recognizer resource and get familiar with the activity's input/output datatypes.

After completing the steps in this guide, you'll have an automation sequence that does the following:

1. Establishes a connection to your Azure Form Recognizer resource ([Azure Form Recognizer Scope](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-scope#azure-form-recognizer-scope)).
2. Creates a new custom training model using the source form documents that you stored during **Setup** ([Train Model](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-train-model#train-model)).
3. Retrieves and outputs the status of the train model operation ([Do While](https://docs.uipath.com/studio/docs/the-do-while-activity), [Get Model Info](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-get-model-info#get-model-info), and [Write Line](https://docs.uipath.com/activities/docs/write-line)).
4. Retrieves and outputs the keys extracted during the training model operation ([Get Model Keys](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-get-model-keys#get-model-keys), [For Each](https://docs.uipath.com/studio/docs/the-for-each-activity), and [Write Line](https://docs.uipath.com/activities/docs/write-line)).
5. Deletes the new custom training model that you created ([Delete Model](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-delete-model#delete-model)).

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/marketplace/marketplace-docs-image-34611-5ff4f474-9d20a093.webp)

## Prerequisites

Before you begin:

1. Complete the Azure Form Recognizer [Setup](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-setup#setup) guide.

## Steps

### Build your project

1. Add the [Azure Form Recognizer Scope](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-scope#azure-form-recognizer-scope) to your project.
2. In the **Subscription Key** and **Endpoint** properties, enter the **Key1** and **Endpoint** values that you noted when creating your [Azure Form Recognizer resource](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-setup#setup).
3. Add the [Train Model](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-train-model#train-model) activity inside the **Azure Form Recognizer Scope** activity.
4. Enter the **Azure Storage Blob Uri** of the blob container that contains the source form documents you're using for your model.
   * For more information, see the [Get shared access signature](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-setup#setup) section in the **Setup** guide.
5. Create and enter a `String` variable in the **Model Id** property (e.g., *modelId*).

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/marketplace/marketplace-docs-image-34583-eaa4824c-381232a8.webp)
6. Add the [Get Model Info](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-get-model-info#get-model-info).
7. In the **Model Id** property, enter the `String` variable you created for the **Train Model** activity (e.g., *modelId*).
8. Create and enter a `KeysResult[]` variable in the **Keys** poperty (e.g., *keys*).
9. Add a [For Each](https://docs.uipath.com/studio/docs/the-for-each-activity) activity after the **Get Model Info** activity.
10. In the **TypeArgument** property, select *String*.
11. In the **Values** property, enter the `KeysResult[]` variable with an array item identifier and the `Keys` property (e.g., *keys(0).Keys*).
12. Inside the **For Each** activity, add a **Write Line** activity.
    1. In the **Text** property, enter *"Key: "+item*.
13. Add the [Delete Model](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-delete-model#delete-model) activity after the **For Each** activity.
14. In the **Model Id** property, enter the `String` variable you created for the **Train Model** activity (e.g., *modelId*).
15. Run the sequence and verify the **Output** window includes the expected values.

    ![docs image](https://dev-assets.cms.uipath.com/assets/images/marketplace/marketplace-docs-image-35152-76bdca55-4dfa0fe1.webp)

You're done!

To learn more about the Azure Form Recognizer activities (including example property inputs/outputs), see the [Activities](https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-activities) page for a complete list of activities and links to the detail pages.
