# Working with Actions

### How to create Action

* Go to Actions tab and press "New" button .

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FbzHkmaGqqyqFiNjJPQZT%2Ffile.excalidraw.svg?alt=media&#x26;token=d6504456-8b26-4716-ac72-4b2d74ff339a" alt="" class="gitbook-drawing">

* "New KanBan Action" page will be shown.  Provide Action **Name**, choose **Context Objec**t, **Type** and **Status** (active or inactive).
* Check "With conditions" if needed to execute actions not always.  Set up Conditions in the section that will be shown below.&#x20;
* When Action Type is selected, a **Settings** section (it's actual header depends on selected Action Type) will be shown below. Configure the action settings based on its type and press "**Save**" button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FxvNAjmn5t5x2ttetpxtJ%2Ffile.excalidraw.svg?alt=media&#x26;token=3b57a37d-00cc-4447-9b09-3c5ceff66701" alt="" class="gitbook-drawing">

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FV7HFoUdBzQVXDNzGYZx7%2Ffile.excalidraw.svg?alt=media&#x26;token=ca7590e9-4d90-4f89-8a74-46c99262ed80" alt="" class="gitbook-drawing">

### Working with existing Action

After the action is created new set of functionality becomes available.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FAh9wqxvB94x9i47tpEyh%2Ffile.excalidraw.svg?alt=media&#x26;token=dddbd421-1129-49b9-830f-929f748fbf25" alt="" class="gitbook-drawing">

#### Clone

Allows to clone the Action.

* Click "**Clone**" button to open popup.
* Enter **New Name**,
* Check "**Open Action After Clone**" if needed  and click "**Clone**" button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FjMsqeEK3hiqnYFoiulDU%2Ffile.excalidraw.svg?alt=media&#x26;token=e0ba1f95-d973-45f5-9933-54485adffea4" alt="" class="gitbook-drawing">

#### Share

Allows to share the Action to Users, Roles, Roles and Subordinates, Public Groups.

* Click "**Share**" button.
* Add Users/Groups/Roles to whom you want to share.
* Select Access Level: **Read Only** or **Read** **and** **Write**.
* Click "**Save**" button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FmYtICExIY0pxxhls9x1k%2Ffile.excalidraw.svg?alt=media&#x26;token=e7db7aac-3c95-4cd9-83d6-adda98290442" alt="" class="gitbook-drawing">

#### Execute

Allows to execute action.&#x20;

* Click "**Execute**" button.
* Add **Source -** Id of the record for which action should be executed (*is shown only if select context object type*).&#x20;
* Add **Variables** if needed.
* Click **Apply** button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2F5ThIxtH2etxMlrfl7KGW%2Ffile.excalidraw.svg?alt=media&#x26;token=b752e766-8a90-48b4-9596-c76b3ea6455b" alt="" class="gitbook-drawing">

#### Execute in Batch

Allows to execute action in batch for specified query.

* Click "**Execute in Batch"** button.
* **Query** - scope of records for which you need to run the action in batch. Query is a SOQL query which should define the list of source records (see [**SF SOQL query**](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm?_ga=2.51528096.866170717.1737723674-134945425.1729792369) language).
* **Batch Size** - is the size of the batch job iteration. E.g., if Query returns 46 records and Batch size = 10, system will start the batch job iteration 5 times.&#x20;
* If "**In Single Call**?" is turned on, the batch job iteration will execute action 1 time and pass it IDs of records in the "ids" variable. If "In Single Call?" is off, the batch job iteration will execute action for each record, passing it's record ID each time.&#x20;
* When "In Single Call?" is off, a "**Pass Source?**" checkbox becomes available. If it is turned on, the record will be passed to action as a Source object, which properties action author can work with. If "Pass Source?" is off, the record ID will be passed to action in the "recordId" variable and action author should configure it's usage itself.
* Add **Variables** if needed.
* Click **Apply** button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2F8Vfrot96tdAQKb4eR6RG%2Ffile.excalidraw.svg?alt=media&#x26;token=a5ecebc6-5fb5-430e-b9d6-26e3f896569b" alt="" class="gitbook-drawing">

#### Execute on Schedule

Allows to schedule execution of the action.

* Click "**Execute on Schedule"** button.
* Enter **Schedule Job Name** .
* **Cron** - Salesforce [cron expression](https://help.salesforce.com/s/articleView?id=analytics.reports_subscription_reporting_cron.htm\&type=5) which sets schedule of job runs - see more details at Salesforce help.
* **Source** - Id of the record for which action should be executed.&#x20;
* Add **Variables** if needed.
* Click **Apply** button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FCyKfT8DlXarPZ0JBSxSF%2Ffile.excalidraw.svg?alt=media&#x26;token=5e1955e5-5f16-4a3d-8f93-a0518ad2d7c5" alt="" class="gitbook-drawing">

#### Execute on Schedule in Batch

Allows to schedule execution of the action in batch for specified query.

* Click E**xecute on Schedule in Batch** button.
* Enter **Schedule Job Name**.
* **Cron** - Salesforce [cron expression](https://help.salesforce.com/s/articleView?id=analytics.reports_subscription_reporting_cron.htm\&type=5) which sets schedule of job runs - see more details at Salesforce help.
* **Query** - scope of records for which you need to run the action in batch. Query is a SOQL query which should define the list of source records (see [**SF SOQL query**](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm?_ga=2.51528096.866170717.1737723674-134945425.1729792369) language).
* **Batch Size** - is the size of the batch job iteration. E.g., if Query returns 46 records and Batch size = 10, system will start the batch job iteration 5 times.&#x20;
* If "**In Single Call**?" is turned on, the batch job iteration will execute action 1 time and pass it IDs of records in the "ids" variable. If "In Single Call?" is off, the batch job iteration will execute action for each record, passing it's record ID each time.&#x20;
* When "In Single Call?" is off, a "**Pass Source?**" checkbox becomes available. If it is turned on, the record will be passed to action as a Source object, which properties action author can work with. If "Pass Source?" is off, the record ID will be passed to action in the "recordId" variable and action author should configure it's usage itself.
* Add **Variables** if needed.
* Click **Apply** button.

<img src="https://3097383375-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK2dgObBO5ydOH2ZXDJLa%2Fuploads%2FGTNDEFFXriTMv0MK5zEM%2Ffile.excalidraw.svg?alt=media&#x26;token=74c6185d-2484-4cfa-a8c8-4c1defbca40b" alt="" class="gitbook-drawing">
