How to include additional key-value pair with RSS trigger data in Zapier webhook action?

I’m working on a Zapier automation that uses an RSS trigger. I want to send the RSS data to a webhook, but I need to add an extra key-value pair to the existing data. Here’s what I’m trying to do:

  1. The RSS trigger fetches some data
  2. I want to send this data to a webhook
  3. Before sending, I need to add a new key-value pair to the existing data

For example, if the RSS data looks like this:

{
  "title": "New Blog Post",
  "content": "This is the content",
  "published_date": "2023-05-15"
}

I want to add a new field called source_url so the final data sent to the webhook looks like:

{
  "title": "New Blog Post",
  "content": "This is the content",
  "published_date": "2023-05-15",
  "source_url": "https://example.com"
}

How can I achieve this in Zapier? When I try to add the new field in the webhook action, it overwrites the existing data instead of adding to it. Any help would be appreciated!

I’ve tackled this issue before, and there’s a neat workaround using Zapier’s ‘Create Custom Action’ feature. It’s a bit advanced, but super flexible.

First, create a new custom action in your Zap. In the custom action, you can use JavaScript to merge your existing RSS data with the new key-value pair.

Here’s a snippet that should work:

let rssData = inputData;
rssData.source_url = 'https://example.com';
output = rssData;

Then, in your webhook step, just map all fields from this custom action. This method preserves all your original RSS data and adds the new field seamlessly.

It’s a bit more setup initially, but it gives you full control over data manipulation. Plus, you can easily add more custom fields later if needed. Give it a shot and let me know how it goes!

hey dave, i’ve done something similar before. try using a ‘formatter’ step between the RSS trigger and webhook action. in the formatter, choose ‘utilities’ then ‘add json key’. this lets you add new key-value pairs without messing up the existing data.

hope that helps! lemme know if you need more details

I’ve encountered a similar challenge in my Zapier workflows. One effective solution is to utilize the ‘Code’ step between your RSS trigger and webhook action. This powerful feature allows you to manipulate the data using JavaScript.

In the Code step, you can access the RSS data and add your new key-value pair. Here’s a basic example of how your code might look:

let output = inputData;
output.source_url = 'https://example.com';
return output;

This approach preserves all existing data while adding your new field. Remember to map the output of this Code step to your webhook action. It’s a flexible method that can handle more complex data transformations if needed in the future.