Question: I'm trying to find out if a url variable exists, and if it doesn't, make sure that it's not empty.

This does not work:

```
<cfif IsDefined('URL.affiliateId') and is not "">
    //
</cfif>

```

Answer: 
```
<cfif structKeyExists(url, 'affiliateID') and trim(url.affiliateID) neq "">...</cfif>

```
You can simplify the logic a bit as well by using <cfparam> to ensure that the URL variable always exists. Then rather than having 2 conditions, you just need 1.

```
<cfparam name="URL.affiliateId" type="string" default="" />

<cfif trim( URL.affiliateId ) is not "">
     do stuff here
</cfif>
```