---
schema_version: "1"
id: 2654dd2afe1af5b5b2b267fd02ae897d563ead92a21cb767b918a341aa190a89
title: RPA Setup Guide
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/financial-services/latest/rpa-setup-guide.md
canonical_url: https://docs.mulesoft.com/financial-services/latest/rpa-setup-guide
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f27e52c75a3112af00ee17d26753e6bc66ca37ec6fb3e67b16f9e0f4758dab39
description: MuleSoft Documentation Site
release: "1.12"
latest: true
---
---
product: Financial Services
version: 1.12
is-latest-version: true
---

# RPA Setup Guide

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

This guide provides instructions for implementing the
[Unlock AMS Through Automation for Insurance Brokers](https://anypoint.mulesoft.com/exchange/org.mule.examples/mulesoft-accelerator-for-financial-services/minor/1.12/pages/3cn-8tr/Use%20case%207%20-%20Unlock%20AMS%20through%20automation%20for%20insurance%20brokers/)
use case, which is part of the MuleSoft Accelerator for Financial Services.

The use case leverages MuleSoft’s Robotic Process Automation (RPA) solution to retrieve customer
data from your Agency Management System (AMS) and automatically load the data into Salesforce
Financial Services Cloud (FSC). To implement this use case, you must set up RPA on the device that
runs the automation process and configure the solution to your specific AMS.

## Before You Begin

- Ensure that the Anypoint Platform account to use has
  [the RPA Automations Manager and RPA Bots Manager permissions](https://docs.mulesoft.com/rpa-home/automation-userrolesandpermissions-anypointrpapermissions).

- Install the latest version of MuleSoft
  [RPA Builder](https://docs.mulesoft.com/rpa-builder/latest/install-and-configure) and
  [RPA Bot](https://docs.mulesoft.com/rpa-bot/latest/installation) from the RPA Manager home page.

- Ensure that you have access to your AMS and its database metadata. Configure the custom fields in
  the \[FINS AMS Salesforce Sync Handler - Implementation Template\], ensuring that the custom field
  names match the column names on the CSV file.

- Ensure that you have access to the Salesforce Financial Services Cloud organization to which your
  AMS data will be loaded.

- Download the `AMS_to_FSC.crpa` file to the same device on which RPA Builder is installed.

## Workflow Overview

1.  Create two projects in RPA Manager:

    - The first project contains the process for getting all relevant datasets and looping over them
      in your AMS. For each dataset, the second project is called.

    - The second project contains the process for getting the data from one AMS dataset and adding
      it to a CSV file, which is imported at a later step to FSC.

2.  Import and adapt the CRPA file in the second project in RPA Builder.

3.  Publish the second project to Anypoint Exchange in RPA Manager.

4.  Build the process for the first project from scratch in RPA Builder.

5.  Deploy a scheduled configuration for the first project.

## Create a Project in RPA Manager

To create a new project in RPA Manager, see
[Create an Automation Project](https://docs.mulesoft.com/rpa-manager/processautomation-manage#create-an-automation-project).
If a new category is needed when creating a project, see
[Create a Category](https://docs.mulesoft.com/rpa-manager/processautomation-prepare-project-category#create-a-category).

Once you create the project,
[move it directly to the Build phase](https://docs.mulesoft.com/rpa-manager/processautomation-develop#build-a-process)
without making any changes.

## Import the CRPA File to RPA Builder

1.  Log in to RPA Builder on the device on which the process runs.

2.  On the [Repository tab in the Explorer pane](https://docs.mulesoft.com/rpa-builder/latest/ui-overview) in RPA
    Builder, click the name of the process you created.

3.  Click **File** on the [Menu Bar](https://docs.mulesoft.com/rpa-builder/latest/ui-overview#menu-bar), and then click
    **Import Project**.

4.  Select the CRPA file you downloaded from Exchange. The project opens in the model pane and
    includes three activities, which you must adapt to your AMS.

## Adapt the CRPA File to Your AMS

1.  Double-click each activity on the model pane to open the workflow.

2.  Compare the displayed process with your process and adapt the action steps accordingly. See
    [Example of Adapting the CRPA File](#example-of-adapting-the-crpa-file) for a detailed example.

3.  Save and upload the project to RPA Manager.

## Transfer the Second Project to the Test Phase and Test It

Now that you have adapted the file to your AMS,
[transfer the project to the Test phase and test it](https://docs.mulesoft.com/rpa-manager/processautomation-deploy#test-a-process-automation).

## Transfer the Second Project to the Production Phase

After successfully testing the project, transfer the project to the Production phase and publish the
project to Anypoint Exchange
[as an invokable run configuration](https://docs.mulesoft.com/rpa-manager/processautomation-deploy#publish-automation-exchange).
For help with this process, refer to:

- [Connecting to RPA Processes from Salesforce Products](https://docs.mulesoft.com/rpa-manager/settings-connect)

- [Use Flows with MuleSoft RPA](https://help.salesforce.com/s/articleView?id=sf.flow_build_use_flows_with_mulesoft_rpa.htm&type=5)

## Implement and Deploy the First Project

Now that you have published the second project as an invokable run configuration, you can call it
from within another process by using the
[REST Call Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-network-rest-call).

The second process should take a list of lookup codes provided via a file, use the
[File Controlled Loop Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-flow-control-file-controlled-loop)
to iterate over all codes, and use the codes within the request body of the REST call.

[Deploy the project](https://docs.mulesoft.com/rpa-manager/processautomation-deploy#deploy-a-process-automation) and
schedule it as needed.

## Example of Adapting the CRPA File

> [!NOTE] The example in this guide uses real-world data to show you how to adapt a CRPA file to a
> specific AMS.

All values for the Activity Parameters used in RPA Builder are test values that you must overwrite
with your own values when creating the run configuration for the process in RPA Manager.

### Process Model

The process model contains the following activities:

1.  Log in to the AMS using credentials and a database name.

2.  Open a record in the AMS database using a lookup code.

3.  Copy data from various fields on the record pages to a CSV file.

![RPA Builder process model](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-process-model.png)

Add activities by clicking on an element on the model panel and choosing an element from the context
menu. For example, the following image shows how to branch off to a second AMS if you are using more
than one AMS and not finding the data you need in the first AMS:

![RPA Builder option for adding an activity to the process model](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-add-activity.png)

The linter automatically checks the model for completeness and displays error and warning messages
to indicate what to change.

Click on an activity to open the editing workflow.

### Activity 1: Log In to the AMS

#### Overview of the Activity Workflow

1.  Decrypt the AMS login credentials that go in through an Activity Parameter.

2.  Run the AMS.

3.  Log in to the AMS by using the decrypted credentials.

4.  Select the database by using another in-going Activity Parameter.

    ![RPA Builder Activity Parameter Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-activity-parameters-wizard.png)

#### Minimum Steps to Adapt in This Workflow

1.  Change the following in the
    [Run Program Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-control-run-program):

    1.  Replace the values in the **File name**, **Parameters**, and **Window Title** fields with
        the values from your AMS.

    2.  Click **Test** to run the application so that you can use it to adapt the following Action
        Steps:

        ![RPA Builder Run Program Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-run-program-wizard.png)

2.  Use the **Start from scratch** option to capture and test a new pattern that indicates that the
    login page of the AMS is visible onscreen:

    ![RPA Builder pattern-selection wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-image-search-wizard.png)

3.  Reidentify the field to enter the password. You might have to add another
    [Keystrokes to App Element Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-app-automation-keystrokes-to-app-element)
    for entering the user name, which would go before the password step.

    ![RPA Builder Keystrokes to App Element Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-keystrokes-app-element-wizard.png)

4.  Reidentify the **Login** button, which is used in the
    [Click App Element Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-app-automation-click-app-element):

    ![RPA Builder Click App Element Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-click-app-element-wizard.png)

5.  Wait for the login process to complete by choosing a pattern that disappears after completion:

    ![RPA Builder pattern-selection wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-choose-pattern.png)

6.  Adapt the other Action Steps of the same types in a similar way. Or, add or delete Action Steps
    based on what is needed to log in to your AMS.

### Activity 2: Find a Record in the AMS

The second activity finds a record in the AMS by using a lookup code.

1.  Enter the lookup code, which was provided as an Activity Parameter, as locate criterion to
    search for the account data set.

2.  Click on the result entry to open the account data, and then wait until it’s fully loaded.

![RPA Builder workflow that enters a lookup code](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-lookup-code.png)

Change the following Action Steps:

1.  Adapt the first Action Steps as you did in the previous Activity.

2.  Adapt the scan area in the
    [AI OCR Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-text-recognition-ai-ocr-screen-based) in
    which RPA Bot searches for the record entry with the lookup code:

    ![RPA Builder AI OCR wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-ai-ocr-wizard.png)

3.  Adapt the rest of the Action Steps as you did in the previous Activity.

### Activity 3: Retrieve and Export Data from the AMS

The third activity retrieves data and exports the data from the AMS so that it can be imported to
Salesforce Financial Services Cloud.

1.  Retrieve account data.

2.  Retrieve the policy data of the account.

3.  Export the data to a CSV file.

![RPA Builder workflow that exports data to a CSV file](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-export-data.png)

Change the following Action Steps:

1.  To retrieve the data, reidentify the fields from which to read in each of the
    [Read Text from App Element Action Steps](https://docs.mulesoft.com/rpa-builder/latest/toolbox-app-automation-read-text-from-app-element)
    and add or delete them as needed.

![RPA Builder Read Text from App Element Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-read-text-app-element-wizard.png)

If necessary, click into a field before reading the text and then use a keystroke to get out of the
field.

![RPA Builder workflow for entering and leaving a field before reading text](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-read-text-tip.png)

To search for text in a special format, you can use
[Optical Character Recognition](https://docs.mulesoft.com/rpa-builder/latest/toolbox-text-recognition-ai-ocr-screen-based)
in combination with regular expressions.

![RPA Builder workflow that uses optical character recognition](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-optical-character-recognition.png)

2.  Ensure that all retrieved data is [pinned](https://docs.mulesoft.com/rpa-builder/latest/common-properties#variables)
    to the
    [Combine Strings Action Step](https://docs.mulesoft.com/rpa-builder/latest/toolbox-variable-handling-combine-strings)
    and adjust if necessary. You can also link more Activity Parameters.

    ![RPA Builder Combine Strings Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-combine-strings-wizard.png)

3.  Add the string to a CSV file as `Pin Variable` and adjust the properties as needed. The CSV file
    must be in the specified format.

    ![RPA Builder Write to Text File Wizard](/mulesoft/current/en-us/financial-services/latest/_images/rpa-setup-write-text-file-wizard.png)

## See Also

- _Salesforce Help_:
  [Account](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm)

- _Salesforce Help_:
  [Prepare a CSV File for an Import or Update in Salesforce](https://help.salesforce.com/s/articleView?id=000381876&type=1)

- _Salesforce Help_:
  [Standard Objects](https://developer.salesforce.com/docs/atlas.en-us.248.0.object_reference.meta/object_reference/sforce_api_objects_list.htm)

- [MuleSoft Accelerator for Financial Services](https://docs.mulesoft.com/financial-services/latest/)
