# Automated Customer Creation

> **Applications:** Salesforce, QuickBooks Online.

**Applications:** Salesforce, QuickBooks Online.

**Description:** When a new opportunity is closed as won in Salesforce, automatically create a customer in QuickBooks Online.

## Steps
1. Open **Studio Web** and create a new project. Make sure that in the New Project window, in the **How to start the automation** drop-down, **Event based** is selected.
2. Drag a [Salesforce: Opportunity Closed And Won](https://docs.uipath.com/activities/other/latest/integration-service/uipath-salesforce-sfdc-opportunity-closed-and-won) trigger activity. In the trigger activity:
   1. Connect to your Salesforce account.

      ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329750-a7599a58-fbc9e59d.webp)

   2. Additional filters may be added to your automation, depending on your needs.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329754-cfc3b326-d9b87ed6.webp)
3. Add a [Salesforce: Get Account](https://docs.uipath.com/activities/other/latest/user-guide/uipath-salesforce-sfdc-get-account-by-i-d) activity to your canvas, and:
   1. For the **Account** property field, select the output of the **Event Trigger** activity, **Opportunity Closed and Won &gt; Opportunity &gt; AccountID.**
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329758-7bde6c19-40f01cd8.webp)
4. Next, add a [Salesforce: Get Contact](https://docs.uipath.com/activities/other/latest/user-guide/uipath-salesforce-sfdc-get-contact-by-i-d) activity to your canvas, and:
   1. For the **Contact** field, select the output of the **Event Trigger**, **Opportunity Closed and Won &gt; Opportunity &gt; ContactID**.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329762-7d71d211-c8cd1a28.webp)
5. Add a [QuickBooks Online: Create Customer](https://docs.uipath.com/activities/other/latest/integration-service/uipath-intuit-quickbooksonline-create-customer) activity to your project.
   1. For the **Display name** field, open the expression editor and type ”merge two strings with a space in between” in the expression generator. It will generate an equivalent expression for you.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329766-048aebe3-c617dbfc.webp)
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329770-ccaaddb8-4e3c6718.webp)
   
   2. Replace `string1` and `string2` with the first name and last name of the contact by inserting variables.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329774-6710016b-b7115e06.webp)
   
   3. For the field **Company name**, set the output to the variable **Get Account &gt; Account &gt; Name**.
   4. For the **Email address** field, you can map it to the contact’s email by using **Get Contact &gt; Contact &gt; Email**.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329778-7afd1eaa-6087e20f.webp)
   
   5. You have the flexibility to map additional fields in the activity, as needed. You can also opt to view extra fields by clicking **Show additional options**. For example, in our scenario, we've mapped the components of the billing address. Keep in mind that there are more fields that can be found within the **Manage Properties** wizard and you can adjust your mapping accordingly.
   
   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/latest-docs-image-329782-e1ce0f1e-f5ca218c.webp)
6. Execute your workflow. The customer is created successfully.
