Solved

Dynamic email/flow content from web feed

  • 10 March 2021
  • 6 replies
  • 676 views

Badge +2

Hi - I have added a custom feed (from Wordpress RSS feed) and this is working fine in the feed preview.

However, I cannot get the content to dynamically populate an email. 

I’ve been through the instructions here: https://help.klaviyo.com/hc/en-us/articles/115005258768-Guide-to-Adding-a-Custom-Web-Feed-in-an-Email#populating-feed-content-in-your-template6

and searched on the forum, but just cannot get this working.

I have setup a text block and set the Repeat Block to feeds.PODCASTS.rss.chanel.item and the Alias item to ‘item’.

Then in the text block source I have added 

<h2>{{ item.title }}</h2>

<p>{{ item.description }}</p>

(both title and description are attributes in the feed)

Below is the output from the feed (to the end of the first item).

Any ideas where I am going wrong?

Thanks

Philip.

{ rss: { "@version": "2.0", "@xmlns:content": "http://purl.org/rss/1.0/modules/content/", "@xmlns:wfw": "http://wellformedweb.org/CommentAPI/", "@xmlns:dc": "http://purl.org/dc/elements/1.1/", "@xmlns:atom": "http://www.w3.org/2005/Atom", "@xmlns:sy": "http://purl.org/rss/1.0/modules/syndication/", "@xmlns:slash": "http://purl.org/rss/1.0/modules/slash/", channel: { title: "Podcast – Chalke Valley History Festival", "atom:link": { "@href": "https://cvhf.org.uk/podcasts/feed/", "@rel": "self", "@type": "application/rss+xml" }, link: "https://cvhf.org.uk", description: "21st to 27th June 2021 - The largest Festival dedicated entirely to History in the UK", lastBuildDate: "Wed, 10 Mar 2021 11:49:20 +0000", language: "en-GB", "sy:updatePeriod": "hourly", "sy:updateFrequency": "1", item: [ { title: "42. AFRICAN-AMERICAN CIVIL RIGHTS", link: "https://cvhf.org.uk/podcasts/42-african-american-civil-rights/", "dc:creator": "Philip Ewen", pubDate: "Wed, 10 Mar 2021 05:00:33 +0000", guid: { "@isPermaLink": "false", "#text": "https://cvhf.org.uk/?post_type=podcast&p=20840" }, description: "In this talk to senior school pupils, Dr Gareth Davies explains what ‘Jim Crow’ was, and what sustained it before examining what destabilised and finally destroyed it. He finishes by discussing what replaced ‘Jim Crow’ and shows evidence of progress.", "content:encoded": "<p><span style="font-weight: 400;">In this talk to senior school pupils, Dr Gareth Davies explains what ‘Jim Crow’ was, and what sustained it before examining what destabilised and finally destroyed it. He finishes by discussing what replaced ‘Jim Crow’ and shows evidence of progress.</span></p>" },

icon

Best answer by sourabhramsingh 11 March 2021, 08:01

View original

6 replies

Badge +4

You’ve mentioned feeds.PODCASTS.rss.chanel.item in your query. 

Please change it to feeds.PODCASTS.rss.channel.item

There could be other issues to that as well, but try changing that first. 

Badge +2

Thank you - that fixed it. Darned typos! Thank you very much indeed.

Is there a resource that I can understand the structure of the data source syntax? The original help guide was talking about feeds.PODCASTS.item and it was only by chance I found someone mentioning the additional ‘rss.channel’ to make it feeds.PODCASTS.rss.channel.item

Thank you very much for your help.

 

 

Userlevel 5
Badge +25

Hi @fillyouin ! That’s a great question. feeds.PODCASTS gets you to the feed itself, and from there, the data structure is based on what your feed contains. Adding .rss gets you into the rss heading, and .channel gets you into the channel subheading. .item is added at the end as the placeholder you’ll use within the block (it’s where the “item” in {{ item.title }} comes from). 

 

I hope that helps clarify a bit! 

Userlevel 7
Badge +57

Just to chime in here, you can also click on the “Preview” button in your Data Feed to see an example set of data it pulls.  Here, you should get a quick glance of what data would be available to use in your Templates.

See here:

Here’s some Klaviyo Documentation to help you navigate:

Badge +2

Thank you all that is really helpful. Much appreciated.

Badge +1

Just to chime in here, you can also click on the “Preview” button in your Data Feed to see an example set of data it pulls.  Here, you should get a quick glance of what data would be available to use in your Templates.

See here:

Here’s some Klaviyo Documentation to help you navigate:

Are you able to access xml blog fielfd the same way you would with JSON?

Also can you use these web feeds in, flows? I was watching a video about IG web feeds from 2018 that specifically mention you cant.

Reply