I'm using a webform to collect applications for an accreditation scheme. Usefully the webform submissions each have a unique submission ID that I can include in the webform-driven email notifications that get sent. And using webform-civicrm integration I can collect the data from the webform submission into CiviCRM for ongoing workflow.

What I want to do is to record the webform submission ID into a custom field in CiviCRM at the same time, so that I can then use it in further email notifications to the people involved. But the [submission] tokens are not available for form components - because the form isn't yet submitted so the values aren't available.

Any way to do this? Or alternatively create a unique ID number in CiviCRM, and then maybe use CiviRules to generate all of the emails?

It seems like such a trivial thing to have a unique reference number, but in Civi the only thing I can see that's useful is a Case ID number and I'd really rather not have to use cases for what is otherwise a very simple process.

  • 2
    wondering if we can see more of the workflow. are you wanting the webform submission id because you email folk with a link to go back and look at it? I am wondering what the value of the submission is v having all the data on eg an Activity and hence giving them a link to the webform with 'aid' in the url
    – petednz - fuzion
    Nov 20, 2018 at 19:20
  • Thanks Pete. I don't need to send people back to the webform. All i want is for each submission to have a unique reference ID that I can use through the entire workflow. For me it makes sense to use the submission ID as it is already there, but because I can't easily get that into a Civi field I can't then reference that ID in mails sent from Civi.
    – Graham
    Nov 21, 2018 at 10:54
  • and having the link to the submission provided in the Activity won't suffice?
    – petednz - fuzion
    Nov 21, 2018 at 18:48

2 Answers 2


there is an extension that allows you to create a CiviRule with trigger webform is submitted: https://github.com/CiviCooP/org.civicoop.civiruleswebform. That might help you, although you probably then still have to create a little CiviRule action that stores the submission ID in the CiviCRM custom field.

Drop me a mail if you want to take this further?


How about this for a unique-reference number:

CRMID-Number is a CiviCRM Custom field - Alphanumeric - Text I've made it: [node:nid]-[random:number]-[current-date:raw]

node id = 421 random number = 758398555 data raw is UNIX timestamp = 1543593293

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.