Drupal's webform integrates with token since 7.x-4.0

Since Webform 7.x-4.0, it supports tokens! It’s not a news but there aren’t any detailed document about how to use it. So here’s my quick note on how to use token on webform default fields.

The maintainers of webform.module used to use their own token system instead of the popular token.module, although many people were asking for token support but the official webform development team didn’t implement it and quicksketch said token support will never be added to webform 6.x or webform 7.x-3.x on issue queue. So, another Drupal developer fizk decided to create a new drupal project Webform Patched which has the same functionality but with token support.

that was the old story.

Now the official webform.module supports token.

See the changed structures.

Old Style Token D7-style token %username [current-user:name]%useremail [current-user:mail]%uid [current-user:uid]%date[submission:date:long]%ip_address [current-user:ip-address]%site [site:name]%nid [node:nid]%title [node:title]%email_values [submission:values]%submission_url [submission:url]%sid [submission:sid]%server[REQUEST_URI][current-page:url]%get[$key][current-page:query:$key]%email[$key][submission:values:$key]%value[$key][submission:values:$key:nolabel]%profile[$key][current-user:$key]
And you can pre-populate the value from the url. ([see here](http://drupal.org/node/296453))

Query Format:

For urls formatted like http://server/node/120?key=bar use [current-page:query:key] to return key value.

Args Format:

For urls formatted like http://server/node/120/key use [current-page:url:args:2] to return key.