---
author_name: Thomas Jentsch
author_profile: https://github.com/tj-66
keywords: tutorial
auto_validation: true
time: 20
tags: [ tutorial>intermediate, software-product>sap-business-technology-platform, software-product-function>sap-cloud-application-programming-model]
primary_tag: software-product>sap-build-process-automation
parser: v2
slug: spa-consume-actions-cap-process
canonical_url: https://developers.sap.com/tutorials/spa-consume-actions-cap-process
---

# Use Action in Business Process
<!-- description --> Learn how to connect to CAP services using Actions in SAP Build Process Automation. Customize or extend standard business processes with additional functionality powered by CAP.

## You will learn
  - How to create and configure a business process
  - How to discover actions from the library
  - How to configure the action for the business process
  - How to release and deploy a business process with actions
  - How to test the process
  

---
### Create Business Process

1. From the Lobby, select **Create**

2. Select **Build an Automated Process**, on next screen click **Business Process**

3. Enter Project Name **`CAP Sample`** and click **Create**

4. On the **Create Process** dialog, enter the Process Name **`myCAP Sample`** and click **Create**, the canvas will be shown

6. Click the canvas to display the **Process Details**

       - Click **Variables** to define the process inputs

       - Click **Configure** to open popup **Configure Process Inputs** 
  
       - Click **Add Input**

       - Enter **`field`** as **Name**, Identifier will be auto filled and **Type** should be **`String`**

       - Click **Apply**

    ![inputs](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/Inputs.png)

### Add Trigger

1. Click **+** to add a new API trigger to your process

    ![trigger](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/AddAPITrigger.png)

2. Enter Trigger Name **`myCAP Trigger`** and click **Create**

    ![name](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/APITriggerName.png)

### Add Actions

1. Click **+** to add a step to your process, from the context menu select **Actions** > **Browse Library**

    ![add action](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/AddActionsToProcess.png)

2. From **Browse Library**
   
    - Filter on project **CAP Sample Actions** 
  
    - Click **Add** on the action **`get list of Todos`** 
  
    ![browse](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/BrowseActions.png)

3. Click **+** next to **End** and repeat the **Actions** > **Browse Library** steps to add the action **`listToString`**

4.  Select **`get list of Todos`** on the canvas and create Destination variable **`capService`**
   
    ![todo destination](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/TodosDestination.png)
   
5. Select **`listToString`** on the canvas and select Destination variable **`capService`**
   
    ![listToString destination](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/ListToStringDestination.png)

6. Select **Inputs** to define the input values for the action

    - Click **Select Item** next to **field**

    -  Select **field** from **Process Inputs**
  
    ![field](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/SelectField.png)

    - Click **Select list** next to **Bind List**

    -  Select **`list responseArray`** from **`get list of Todos`**
  
    ![list](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/SelectList.png)

    The **Inputs** for **`listToString`** should show the following values:

    ![list inputs](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/ListToStringInputs.png)


### Release and Deploy

1. **Save** the process **`myCAP Sample`**, click **Release**.

2. On popup **Release Project**, click **Release**.
    
3. Click **Deploy**.
   
4. Choose an **Environment** and select **Deploy**.
     
    ![Choose environment](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/environment.png)

5. You can see your trigger in the list, click **Deploy**.

    ![deploy](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/trigger.png)

6. In the **Define Variables** section, select Destination **`Demo_CAP_Sample_Library`** and click **Deploy**.

    ![variables](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/Deploy-2.png)


### Test Business Process

1. From **SAP Build**, click **Monitoring**

2. Select **Manage** > **Processes and Workflows**
   
3. Select **`myCAPSample`**

    ![process](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/MonitorCAP.png)

4. Click **Start New Instance** 
   
    - Enter the JSON as input parameter values
   ```JSON
   { "field" : "id" }    
   ```

    - Click **Start New Instance and Close**

    ![start](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/StartInstance-1.png)

5. Select **Monitoring** > **Process and Workflow Instances**, make sure your instance is in the list, **clear** all filters

    ![run](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/RunInstances.png)

6. Click the line to display the details of the instance

    >The result of the action `listToString` is shown as comma separated value string    

    ![result](https://raw.githubusercontent.com/sap-tutorials/sap-build-process-automation/main/tutorials/spa-consume-actions-cap-process/RunInstanceResults.png)

---

