CFB Snippet Dialog with Default Values

I like to use snippets in ColdFusion Builder. Most of mine just dump in a chunk of code, like a try/catch block. However, I have a couple where the snippet pops up a dialog box to prompt for values, like this one for cfquery:

ColdFusion Builder Snippets Dialog

But what if I want a default value to always appear in one of the text boxes? I googled and couldn’t find how to do this. So I started experimenting and figured it out.

Here is the Snippet Details for the above dialog box:

ColdFusion Builder Snippets Details

In the Start Block I have $${name} and $${datasource}. This instructs CFB to open a dialog box to prompt for those values. If I want to supply a default value for one of these boxes, I just need to add it with a “:”, like this:

Snippet Start Block with Default Value

Having added “:myFavDB”, when I use the snippet I now get this:

Snippet with default value

So if you know that most of the time you will always use the same datasource, you can set a default value. But for the times you need a different datasource, you just have to replace “myFavDB” with the datasource you need, and you’re all set!