Webflow Trigger - Limit the trigger to a collection

Dear community,

How can I limit the Webflow trigger to a single CMS collection? I have several collections including one for news and I want to limit the event only when there is new item in news collection.

Thanks for your help!
Jean

Hey @Jean_WebexpR, I don’t think that’s possible in the trigger node itself unless I am missing something. Could you simply put an IF node after your trigger to verify whether you want to proceed with the current item from the trigger?

1 Like

Good idea! Could you just show me how do I configure the IF to get the right collection?

Sure, you’d typically use an expression for that. Could you share an example output from your trigger node to see if there’s a field we can use for filtering? That way I can help find a suitable expression to use in your IF Node :slight_smile:

I launched the trigger and created a new article. Here is the code :slight_smile:

[
{
"_archived": false,
"_draft": false,
"date-de-publication": "2022-03-30T00:00:00.000Z",
"post-excerpt-card": "Post - Excerpt (Card)",
"name": "Post - Title",
"post-body": [
{
"_id": "586dac5f-5cc2-453e-dccc-3a052acb7c35",
"tag": "p",
"classes": [
],
"children": [
"586dac5f-5cc2-453e-dccc-3a052acb7c36"
],
"type": "Paragraph"
},
{
"_id": "586dac5f-5cc2-453e-dccc-3a052acb7c36",
"text": true,
"v": "Post - Body"
}
],
"post-summary": "Post - Body",
"slug": "post-title",
"post-thumbnail-image": {
"fileId": "623d97572af8016562edbc5f",
"file": {
"_id": "623d97572af8016562edbc5f",
"variants": [
{
"_id": "623d97593d2b8ffe14c8a109",
"origFileName": "image%20(3)-p-500.png",
"fileName": "623d97572af8016562edbc5f_image%20(3)-p-500.png",
"format": "png",
"size": 62887,
"width": 500,
"quality": 100,
"error": "FILESIZE_EXCEEDS_CAP"
},
{
"_id": "623d97593d2b8f3776c8a10a",
"origFileName": "image%20(3)-p-800.png",
"fileName": "623d97572af8016562edbc5f_image%20(3)-p-800.png",
"format": "png",
"size": 117758,
"width": 800,
"quality": 100,
"error": "FILESIZE_EXCEEDS_CAP"
}
],
"origFileName": "image (3).png",
"fileName": "623d97572af8016562edbc5f_image (3).png",
"fileHash": "79467ea4fe47d22c3910b01e8d6f8887",
"s3Url": "https://s3.amazonaws.com/webflow-prod-assets/61d699de7084bbe8881948fc/623d97572af8016562edbc5f_image%20(3).png",
"mimeType": "image/png",
"size": 26167,
"width": 901,
"height": 457,
"database": "61d699de7084bbe8881948fc",
"createdOn": "2022-03-25T10:20:07.236Z",
"__v": 1
},
"fileSize": 26167,
"url": "https://uploads-ssl.webflow.com/61d699de7084bbe8881948fc/623d97572af8016562edbc5f_image%20(3).png",
"alt": null
},
"post-main-image": {
"fileId": "623d97572af8016562edbc5f",
"file": {
"_id": "623d97572af8016562edbc5f",
"variants": [
{
"_id": "623d97593d2b8ffe14c8a109",
"origFileName": "image%20(3)-p-500.png",
"fileName": "623d97572af8016562edbc5f_image%20(3)-p-500.png",
"format": "png",
"size": 62887,
"width": 500,
"quality": 100,
"error": "FILESIZE_EXCEEDS_CAP"
},
{
"_id": "623d97593d2b8f3776c8a10a",
"origFileName": "image%20(3)-p-800.png",
"fileName": "623d97572af8016562edbc5f_image%20(3)-p-800.png",
"format": "png",
"size": 117758,
"width": 800,
"quality": 100,
"error": "FILESIZE_EXCEEDS_CAP"
}
],
"origFileName": "image (3).png",
"fileName": "623d97572af8016562edbc5f_image (3).png",
"fileHash": "79467ea4fe47d22c3910b01e8d6f8887",
"s3Url": "https://s3.amazonaws.com/webflow-prod-assets/61d699de7084bbe8881948fc/623d97572af8016562edbc5f_image%20(3).png",
"mimeType": "image/png",
"size": 26167,
"width": 901,
"height": 457,
"database": "61d699de7084bbe8881948fc",
"createdOn": "2022-03-25T10:20:07.236Z",
"__v": 1
},
"fileSize": 26167,
"url": "https://uploads-ssl.webflow.com/61d699de7084bbe8881948fc/623d97572af8016562edbc5f_image%20(3).png",
"alt": null
},
"post-category": "6202f7cefd48a8559742810e",
"updated-on": "2022-03-25T13:04:30.660Z",
"updated-by": "Person_619e586f72bd655aa970453d",
"created-on": "2022-03-25T13:04:30.660Z",
"created-by": "Person_619e586f72bd655aa970453d",
"published-on": null,
"published-by": null,
"_cid": "6202f7cefd48a80a9d428046",
"_id": "623dbddeb2c43657d276f2ae"
}
]

Thank you! From looking at the example data it seems you are getting the _cid field from the trigger. According to Webflow’s documentation this is a unique identifier for the collection.

So you could connect your Webflow trigger to an IF node comparing this value with the expected value for your collection. If you add a new string condition in your IF node and add an expression like so:

image

In the expression editor, navigate to the _cid field (make sure the trigger node has been executed previously, otherwise you wouldn’t see any data):

This should add an expression like {{$json["_cid"]}}. Whenever your workflow runs, it would read the value of the _cid field.

In the value 2 field of the IF node you can simply type the expected value 6202f7cefd48a80a9d428046 like so:

Now whenever your trigger runs, only new items with the right collection would come out of your IF node’s true output. Everything else would go to the false output (which you can simply ignore).

1 Like

@MutedJam it works well! Thank you very much for your help and your time!

1 Like

Awesome, I am glad to hear this helps. Many thanks for confirming :slight_smile: