Columnmap "Gotcha" with CFFEED

This post is more than 2 years old.

I ran into this bug a week or so ago and just helped a user who ran into the same problem. When providing a query to CFFEED to generate an RSS string, you can provide alias information in the form of a columnMap structure. Basically it is a way to tell ColdFusion that column X maps to property Y of the RSS feed. If you try to use this feature though you will probably run into a bug. Consider this code from ColdFusionBloggers's RSS feed:

<cfset items = application.entries.getEntries(1,url.max)> <cfset props = {version="rss_2.0",title=" Feed",link="",description="Feed of the latest items aggregated."}> <cfset cmap = {publisheddate = "posted", rsslink = "url" }>

<cfset items = items.entries>

<cffeed action="create" properties="#props#" columnMap="#cmap#" query="#items#" xmlVar="result">

<cfcontent type="text/xml" reset="true"><cfoutput>#result#</cfoutput>

The variable cmap is my columnMap structure. When I tried this it didn't work and threw an error:

The query attribute input does not contain any column by the name of url.

There is a problem in the column mappings specified in the columnMap structure.

Turns out that the columnMap structure will only work if you use upper case. So I switched around my structure to look like so:

<cfset cmap = {publisheddate = "POSTED", rsslink = "URL" }>
Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

Archived Comments

Comment 1 by Jayesh Viradiya posted on 7/31/2007 at 9:56 AM


We already have this bug in our tracker.

Adobe CF Team

Comment 2 by Raymond Camden posted on 7/31/2007 at 5:41 PM

Yep, I think that was me. :)