Skip to main content

Are "Atom Based" RSS Feed-based emails using the BuildRowsetFromXML ampscript function?

 

I am well aware of the existing documentation on how to use BuildRowsetFromXML. 

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/rssFeedEmail.htm

 

However, I was looking for a way to use the same technique to display a posts from my youtube channel. 

The formatting of the 'atom based' feed from youtube is different than that of the cleanly formatted root xml examples or other rss 2.0 feeds that I have been able to successfully get working. 

 

My initial problem I see is I am unable to parse this feed with the BuildRowsetFromXML function when attempting to key in on the //feed/entry/title and other nodes similar to how what's demonstrated in the well documented example for creating rss feeds in email messages.

 

[

var @xml, @titles, @title, @uris, @uri, @rowCount1

 

Set @xml = HTTPGet("https://www.youtube.com/feeds/videos.xml?channel_id=UCUpquzY878NEaZm5bc7m2sQ")

 

set @titles = BuildRowsetFromXML(@xml,"//feed/entry/title",1)

 

set @rowCount1 = RowCount(@titles)

outputline(concat("<br>rowCount1: ",@rowCount1))

]

 

I get an count of '0' when I attempt to use the count function on the rowCount1 variable.

Perhaps I am missing something really simple. Ultimately, once I see it successfully display the correct total number of entries present I will move forward with creating a custom formatted display for the rest of the desired elements. Again, the url I am trying is a youtube "atom based" feed. 

2 条评论
  1. 2018年10月26日 17:28
    Hi @Russell R

    1) Hope your xml has the child entities feed --> entry --> title appropriatey. If not please remove any complex multiple outer entities from the xml. For ex: feeds --> feed --> entry --> title.

    2) or in order to narrow down the issue You can try with only one level of entities like

    set @titles = BuildRowsetFromXML(@xml,"//feed/entry",1)

    Remove the last child entity from the xml file and test it. If it works well, then the root cause is multi level child entities.

    3) You can try with ConCat function by having temp xml for parsing the third level of the entity.

0/9000