---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://yandex.ru/support/forms/en/call-function.md
  - https://yandex.ru/support/forms/ru/call-function.md
  - href: en/call-function.md
    type: text/markdown
    title: Markdown version
  - href: llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/forms/en/llms.txt

# Invoking a Cloud Functions function

You can integrate a form with a [Cloud Functions function](https://yandex.cloud/en/docs/functions). For example, you can collect user data and transfer it to a website or database to register customers using the form.

 {% note alert "" %}

You can integrate a form with Cloud Functions functions only using Yandex Forms for Business. To do this, make sure a form has a [Yandex Cloud organization](https://yandex.cloud/en/docs/organization/operations/enable-org) enabled with a [cloud configured](https://yandex.cloud/en/docs/resource-manager/operations/cloud/create).

{% endnote %}

### Step 1. Create a service account {#step-one}

1. Go to the [Yandex Cloud management console](https://console.cloud.yandex.com).
1. In the left-hand panel, select the folder to create a function in.
1. In the top-right corner, click ![](_assets/svg/actions.svg)</svg> → **Create service account**.
1. In the service account creation window, fill in the following fields:
	1. **Name**; it may only contain lowercase Latin letters, numbers, and hyphens.
	1. **Description**; it may contain any characters.
	1. In the **Roles in folder** field, add the `functions.functionInvoker` role.
1. Tap **Create**.

If no billing account is linked to your Yandex Cloud account, a window for creating a billing account will open. Fill in its fields to create an account. For more information, see [{#T}](https://yandex.cloud/en/docs/getting-started/individuals/registration#new-account)

### Step 2. Create a service account key {#step-two}

1. In the left-hand panel of the [management console](https://console.cloud.yandex.com), select the folder where the appropriate service account is located.
1. Go to the **Service accounts** tab.
1. Select the account you need.
1. In the top panel on the account page, click **Create new key** → **Create API key**.
1. Provide a brief description for the key.
1. Tap **Create**.
1. This will open a window with the key ID and the secret key. Store them in a secure place. You will not be able to access them after you close the window.

### Step 3. Enable cloud function invocation {#step-three}

1. In Yandex Forms, open the form for which you need to set up integration with a cloud function.
1. Go to the **Settings** tab and select **Additional** in the left panel.
1. Under **Cloud function key**, fill in the **Key ID** and **Secret key** fields. Paste the values you copied when creating the service account key there.
1. Click **Save**.

### Step 4. Create a cloud function {#step-four}

1. Go back to the [Yandex Cloud management console](https://console.cloud.yandex.com).
1. In the left-hand panel, click ![](_assets/svg/dots-9.svg) and select Cloud Functions.
1. In the top-right corner, click **Create function**.
1. On the function creation page, fill in the following fields:
	1. **Name**; it may only contain lowercase Latin letters, numbers, and hyphens.
	1. **Description**; it may contain any characters.
1. Select the programming language that your function will be written in.
1. Select a tab with the function source:
	* **Code editor** to write the function code directly in it.
	* **Object Storage** to select a bucket and object with the appropriate function.
	* **ZIP archive** to attach a `.zip` file with the appropriate function.
1. You can optionally set up the function parameters and logging. All parameters required for creating a function are preset.
1. Click **Save changes**.
1. On the function page, copy the value from the **ID** field.

To learn more about creating cloud functions, see the [documentation for cloud functions](https://yandex.cloud/en/docs/functions/quickstart/create-function/index).

### Step 5. Set up integration {#step-five}

1. Go back to the form and click the **Integrations** tab.
1. Select a group of actions to set up issue creation in and click Cloud Functions at the bottom of the group.
1. In the **Function code** field, paste the function ID that you copied in the previous step.
1. Under **Parameters**, you can optionally select additional parameters to be transferred to the function.
1. Click **Save**.

Responses to the form will be delivered in JSON format. See its structure below:

```json
{
	"id":<form_response_ID>,
	"uid":"<user_ID>",
	"data":{
		"<question_ID_with_its_type_specified>":{
			"value":<answer_to_question>,
			"question":{
				"id":<question_ID>,
				"slug":"<question_ID_with_its_type_specified>",
				"options":{
					<question_parameters>
				},
				"answer_type":{
					"id":<question_type_ID>,"slug":"<question_type>"
				}
			}		
		}
	}
,"survey":{
	"id":"<form_ID>"
	},
"created":"<response_date>",
"cloud_uid":"<user_ID>"
}
```

You can view the sent request and the function execution results on the [completed integrations](https://yandex.ru/support/forms/en/notifications-history.md) page.

<!-- source: en/_assets/style.md -->

<!-- endsource: en/_assets/style.md -->
