How to generate an unique serial ID based on a select value I am Drupal beginner. I have created one webform with some fields (name, college, branch, address, email, contact number etc.). And when this form gets submitted I need to generate a unique registration number based on the selected college code and a serial number).

I also installed Webform Rules module but I don't understand how to achieve that.

Can anyone please help me to generate unique serial ID based on a field value during the Webform submission?
You can use webform hooks for add your custom code before sending the data or saving it into the database. Create hidden field in webform and set the value of the same using hook_webform_submission_presave
For Ex. 

function yourmodule_webform_submission_presave($node, &amp;$submission) {
  // Update some component's value before it is saved.
  $component_id = 4; // where 4 is your hidden component id
  // Add your logic for registration code
  $submission-&gt;data[$component_id][0] = 'registration_code_you_wish_to_set';
}


Or If you want unique registration number check this module http://drupal.org/project/regcode

Hope this helps.