1

I've followed ET documentation regarding pulling data from RSS feed to email that can be found here:

http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/how_to_include_an_rss_feed_in_an_email_message_using_ampscript/

I've created simple code:

%%[
SET @xmlTemp = ContentAreaByName("my contents\XML\XMLtest")
SET @xml = Replace(@xmlTemp, "content:encoded", "contentencoded")
SET @titles = BuildRowsetFromXML(@xml,"//item/title",1)
]%%

%%=Field(Row(@titles, 1), 'Value')=%%

It works fine when it's implemented in landing page but generates error when it's used in email. I tried to wrap output into TreatAsContent() but still nothing

  • Mateusz, can you provide RSS feed details? Also maybe extra bracket in your code %%=Field(Row(@titles, 1), 'Value')=%% but not sure that is the issue. – Palash Rai Nov 12 '15 at 12:09
  • Hey sure, feedforall.com/sample.xml – Mateusz Bartkowiak Nov 12 '15 at 12:15
  • And You are right, there was an additional bracket but I removed it and I still can't make it to work – Mateusz Bartkowiak Nov 12 '15 at 12:23
1

You have to check RowCount of title before returning the field value.

   %%[
    SET @xmlTemp = ContentAreaByName("my contents\XML\XMLtest")
    SET @xml = Replace(@xmlTemp, "content:encoded", "contentencoded")
    SET @titles = BuildRowsetFromXML(@xml,"//item/title",1)
        If RowCount(@titles) > 0 Then
    ]%%
         %%=Field(Row(@titles, 1), 'Value')=%%
    %%[EndIf]%%

Output RSS Solutions for Restaurants

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.