# Execute Connection Command

{% hint style="info" %}
**Block Information**

Available in: Page Flow and Cloud Flow

Toolbox Category: Connections

Block Type: [Regular](https://docs.zingy.ai/app-editor/block-anatomy#regular-block)
{% endhint %}

The **`Execute Connection Command`** block is used to invoke a [command/operation](https://docs.zingy.ai/connections#operation-commands) on a [connection](https://docs.zingy.ai/app-editor/connections) of your app.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FFVHsr4KSkkXRvjfDy09g%2Fimage.png?alt=media&#x26;token=f6ba6a7c-62fa-4fa7-b5a6-cd50536ab9cb" alt="" width="437"><figcaption><p>Execute Connection Command block</p></figcaption></figure></div>

{% hint style="success" %}
Use the [Execute API Call](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/execute-api-call) block for invoking the [API Call service](https://docs.zingy.ai/app-editor/connections/services/api-call) based [connections](https://docs.zingy.ai/app-editor/connections).
{% endhint %}

The block consists of the following (from top to bottom)::

* *Connection Name:* [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the name of the [connection](https://docs.zingy.ai/app-editor/connections) to use.
* *Command:* [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the [command/operation](https://docs.zingy.ai/connections#operation-commands) of the [connection](https://docs.zingy.ai/app-editor/connections) to use.
* *Data*: Optional [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts an [object](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the data to be used when invoking the command/operation. Refer to the specific commands documentation for further details.
* *Success Tasks*: a [Flow Parameter](https://docs.zingy.ai/app-editor/block-anatomy#flow-parameters) where you connect blocks that specify what you want done when the operation completes successfully. The [Connection Data](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/connection-data) block can be used to access the output of the command/operation.
* *Fail Tasks*: a [Flow Parameter](https://docs.zingy.ai/app-editor/block-anatomy#flow-parameters) where you connect blocks that specify what you want done when the operation reports an error. The [Connection Error](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/connection-error) block can be used to access the error information.

***

## Usage Example

The image below shows an example of the **`Execute Connection Command`** block where the command *iccPaymentIntent1* ( [Create Payment Intent](https://docs.zingy.ai/connections/services/stripe#create-payment-intent) ) is invoked for an amount of 100.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FwsRj8mAIqtCN5Vny1Cy5%2Fimage.png?alt=media&#x26;token=3532d0ea-34e3-4955-b625-c9cf45017f47" alt=""><figcaption><p>Example of Execute Connection Command block</p></figcaption></figure>

Upon success, the [Get Object Property](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/get-object-property) block is used to access the *client\_secret* and *publishable\_key* properties from the [Connection Data](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/connection-data) block which represents the output of the command. The *client\_secret* and *publishable\_key* properties are called to the function *process payment.*

If there was an error with the operation, the [Show Information Popup](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/show-information-popup) block is used to show the error information.
