You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This is only applicable for `After Update` event.
40
39
- Select the fields for which webhook should be triggered.
41
40
- If no field is selected, any field update will trigger webhook
42
-
6.**Method & URL** : Specify the endpoint that the webhook will call when triggered. You can choose from the following HTTP methods: GET, POST, PUT, DELETE, PATCH, and HEAD.
8.[Optional]**Body** : Configure request body. You can use [handlebar syntax](https://handlebarsjs.com/guide/#simple-expressions) to access and manipulate the data easily. For example, `{{ json event }}` will give you the complete event data (default behaviour if body not configured).
45
-
9.[Optional] Click **Test** webhook button to verify if parameter are configured appropriately (with sample payload)
46
-
10. Click **Create Webhook** button to complete webhook creation
41
+
42
+
6.[Optional]**Trigger only when specific form submitted**: details [here](#webhook-on-specific-form-submission-)
43
+
> This is only applicable for `After Insert` event.
44
+
- Select the form for which webhook should be triggered.
45
+
46
+
7.**Webhook Action** : Select the action to be performed when webhook is triggered. Action can be one of the following:
47
+
-**HTTP Request** : Send an HTTP request to a specified URL. You can configure the HTTP method, headers, parameters, and body of the request.
48
+
-**Method & URL** : Specify the endpoint that the webhook will call when triggered. You can choose from the following HTTP methods: GET, POST, PUT, DELETE, PATCH, and HEAD.
-**Body** : Configure request body. You can use [handlebar syntax](https://handlebarsjs.com/guide/#simple-expressions) to access and manipulate the data easily. For example, `{{ json event }}` will give you the complete event data (default behaviour if body not configured).
51
+
52
+
-**Run Script** : Run a custom script using NocoDB's built-in scripting engine. You can write JavaScript code to perform various actions when the webhook is triggered.
53
+
-**Script** : Select the script to be executed when the webhook is triggered. You can create and manage scripts in the `Scripts` tab in the left sidebar.
54
+
55
+
8.[Optional] Click **Test** webhook button to verify if parameter are configured appropriately (with sample payload)
56
+
9. Click **Create Webhook** button to complete webhook creation
47
57
48
58
49
59
### Trigger Source and Event
50
60
51
61
Webhooks in NocoDB can be configured based on the source of the trigger and the type of event. The table below outlines the available combinations:
| Record | Send Me Everything | Triggers on any record insert, update, or delete operation |
56
-
|| After Insert | Triggers after one or more records are inserted |
57
-
|| After Update | Triggers after one or more records are updated |
58
-
|| After Delete | Triggers after one or more records are deleted |
59
-
| Button Trigger | — | Triggers when a button field is clicked |
66
+
|| After Insert | Triggers after one or more records are inserted |
67
+
|| After Update | Triggers after one or more records are updated |
68
+
|| After Delete | Triggers after one or more records are deleted |
69
+
| Button Trigger | — | Triggers when a button field is clicked |
60
70
61
71
> For more details on using **Button Trigger** webhooks with the **Button** field, see the [Button field documentation](/docs/product-docs/fields/field-types/custom-types/button).
62
72
@@ -71,20 +81,56 @@ A webhook will only be triggered if the condition transitions from **not met** t
71
81
72
82
**In short**, a webhook is triggered only when the condition changes from **false** (old record) to **true** (new record).
73
83
74
-
<Callouttype="note">
75
-
**Note:** Conditions are not applicable for Manual Trigger webhook.
76
-
</Callout>
84
+
<Callouttype="note">Conditions are not applicable for Manual Trigger webhook.</Callout>
77
85
78
86
### Webhook on field changes ☁
79
87
80
-
<Callouttype="note">
81
-
**Note:** This feature is only available in the paid plans, in both cloud & self-hosted.
82
-
</Callout>
88
+
<Callouttype="note">This feature is only available in the paid plans, in both cloud & self-hosted.</Callout>
83
89
84
90
For **After Update** event, you can configure webhook to trigger only when **certain fields are updated**. For example, trigger webhook only when `Status` is updated. You can also configure multiple fields.
85
91
86
92

87
-
93
+
94
+
95
+
### Webhook on specific form submission ☁
96
+
<Callouttype="note">This feature is only available in the paid plans, in both cloud & self-hosted.</Callout>
97
+
98
+
For **After Insert** event, you can configure webhook to trigger only when a **specific form is submitted**. For example, if you have multiple forms for a table, you can choose to trigger webhook only when `Form A` is submitted.
99
+
100
+

101
+
102
+
103
+
### Webhook with custom payload ☁
104
+
105
+
<Callouttype="note">
106
+
This feature is only available in the paid plans, in both cloud & self-hosted.
107
+
</Callout>
108
+
109
+
In the enterprise edition, you can set up a personalized payload for your webhook. Just head to the `Body` tab to make the necessary configurations. Users can utilize [handlebar syntax](https://handlebarsjs.com/guide/#simple-expressions), which allows you to access and manipulate the data easily.
110
+
111
+
Use `{{ json event }}` to access the event data. Sample response is as follows
112
+
```json
113
+
{
114
+
"type": "records.after.insert",
115
+
"id": "0698517a-d83a-4e72-bf7a-75f46b704ad1",
116
+
"version": "v3",
117
+
"data": {
118
+
"table_id": "m969t01blwprpef",
119
+
"table_name": "Table-2",
120
+
"view_id": "vwib3bvfxdqgymun",
121
+
"view_name": "Table-2",
122
+
"rows": [
123
+
{
124
+
"Id": 1,
125
+
"Tags": "Sample Text",
126
+
"CreatedAt": "2024-04-11T10:40:20.998Z",
127
+
"UpdatedAt": "2024-04-11T10:40:20.998Z"
128
+
}
129
+
]
130
+
}
131
+
}
132
+
```
133
+
88
134
89
135
### Webhook response sample
90
136
@@ -210,38 +256,6 @@ For **After Update** event, you can configure webhook to trigger only when **cer
210
256
</Tabs>
211
257
212
258
213
-
### Webhook with custom payload ☁
214
-
215
-
<Callouttype="note">
216
-
This feature is only available in the paid plans, in both cloud & self-hosted.
217
-
</Callout>
218
-
219
-
In the enterprise edition, you can set up a personalized payload for your webhook. Just head to the `Body` tab to make the necessary configurations. Users can utilize [handlebar syntax](https://handlebarsjs.com/guide/#simple-expressions), which allows you to access and manipulate the data easily.
220
-
221
-
Use `{{ json event }}` to access the event data. Sample response is as follows
222
-
```json
223
-
{
224
-
"type": "records.after.insert",
225
-
"id": "0698517a-d83a-4e72-bf7a-75f46b704ad1",
226
-
"version": "v3",
227
-
"data": {
228
-
"table_id": "m969t01blwprpef",
229
-
"table_name": "Table-2",
230
-
"view_id": "vwib3bvfxdqgymun",
231
-
"view_name": "Table-2",
232
-
"rows": [
233
-
{
234
-
"Id": 1,
235
-
"Tags": "Sample Text",
236
-
"CreatedAt": "2024-04-11T10:40:20.998Z",
237
-
"UpdatedAt": "2024-04-11T10:40:20.998Z"
238
-
}
239
-
]
240
-
}
241
-
}
242
-
```
243
-
244
-
245
259
#### Discord Webhook
246
260
Discord webhook can be configured to send messages to a Discord channel. Discord request body should contain content, embeds or attachments, otherwise request will fail. Below is an example of Discord webhook payload. More details can be found [here](https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html)
0 commit comments