Dump or list all ColdFusion Variables in all scopes.

Dump or list all ColdFusion Variables in all scopes.

On some occasions you may run into issues where you need a variable but your not sure what scope it’s in. Well I’ve found the code below extremely helpful for finding what scope the variable I’m looking for is in.

	<cfdump var="#getPageContext().getBuiltInScopes()#"/>

Basically the function, “getPageContext().getBuiltInScopes()” will list all variables in all scopes.

Enjoy! :)

14 responses so far ↓

Patrick Spenceley - May 16, 2011 at 8:59 AM

CF9 [cfdump var="#getPageContext().getCFScopes()#"/]

Michael - May 16, 2011 at 9:51 AM

Nice but in CF9 it dumps an array or structs with no indication of the scope name of each array index (session, url, cgi, etc.). It only dumps a subset of scopes as well. It looks like: [1] = CGI [2] = ?? [3] = URL [4] = FORM [5] = COOKIE [6] = CLIENT

Mike - May 16, 2011 at 5:14 PM

This is great...thanks for pointing it out!

Mark Gregory - May 16, 2011 at 5:54 PM

Strangely, my getPageContext has no getBuiltInScopes. Running CF9, pretty sure no .01 update on the box I was testing with. It does of course have a *lot* of other very interesting functions, but no getBuiltInScopes. Will poke around a bit, report back if I find anything worth reporting.

Mark Gregory - May 16, 2011 at 6:02 PM

Ah ha, I have it in getCFScopes: writeDump(getPageContext().getCFScopes());

Gert Franz - May 17, 2011 at 6:48 PM

In Railo you can do That dumps out all the scopes a variablename can be found in. Gert

Gert Franz - May 17, 2011 at 6:49 PM

Seems to eat all the brackets... well then: writeDump(getMetaData('variablename', true)); Gert

SloanBarbara23 - May 23, 2011 at 10:30 AM

People in the world get the http://bestfinance-blog.com">loan from different creditors, because it's easy and fast.

Alberto Serize - Sep 15, 2011 at 9:47 AM

This tag is not longer available on versions of Coldfusion 9.0.0 or greater... The new tag is this tag only outputs local variables and queries. You may also need to increase the requesttimeout on the page using the following tag

Alberto Serize - Sep 15, 2011 at 9:48 AM

Sorry... It looks like my comment was stripped out.. here is the tag you need to dump getPageContext().getVariableScope()

mortgage loans - Nov 22, 2011 at 7:56 PM

Different people in all countries receive the credit loans from various creditors, just because it is comfortable.

qithfkof - Feb 16, 2012 at 11:45 AM

iwwvkfhm

ddxrkh - Feb 17, 2012 at 1:22 AM

cpdwfy

cash advance - Feb 20, 2012 at 12:37 PM

xpswwi http://onlineukpaydayloans.co.uk/ Payday Loans UK =-] http://fastpaydayloansus.com/ ">instant payday loans 8]]] [url=http://fastpaydayloanscanada.ca/]Payday Loan[/url] %-[[[

Leave a Comment

Leave this field empty: