Answers.Body: <p>there is an extension that allows you to create a CiviRule with trigger webform is submitted: <a href="https://github.com/CiviCooP/org.civicoop.civiruleswebform" rel="nofollow noreferrer">https://github.com/CiviCooP/org.civicoop.civiruleswebform</a>. 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.</p>
  
  <p>Drop me a mail if you want to take this further?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-20T16:18:14.443Z
Answers.LastActivityDate: 2018-11-20T16:18:14.443Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>How about this for a unique-reference number:</p>
  
  <p>CRMID-Number is a CiviCRM Custom field - Alphanumeric - Text
  I've made it:
  [node:nid]-[random:number]-[current-date:raw]</p>
  
  <p>node id = 421
  random number = 758398555
  data raw is UNIX timestamp = 1543593293</p>
  
  <p><a href="https://i.sstatic.net/lrHRl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lrHRl.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-30T16:00:25.123Z
Answers.LastActivityDate: 2018-11-30T16:00:25.123Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>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.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-20T19:20:45.513Z
Comments.Text: 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
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-21T10:54:10.957Z
Comments.Text: 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.
Comments.UserDisplayName: Graham
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-21T18:48:47.587Z
Comments.Text: and having the link to the submission provided in the Activity won't suffice?
Comments.UserDisplayName: petednz - fuzion
Tags: <webform-civicrm>
Title: How to record a webform submission ID in a CiviCRM field?
ThreadText: # How to record a webform submission ID in a CiviCRM field?
  
  (Asked by: username_0 on 2018-11-20)
  
  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.
  
  **Tags:** webform-civicrm
  
  > **Comments:**
  > **username_1**: 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  
  > **username_0**: 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.  
  > **username_1**: and having the link to the submission provided in the Activity won't suffice?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-11-20. Score: 3
  
  there is an extension that allows you to create a CiviRule with trigger webform is submitted: <https://github.com/username_2/org.username_2.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?
  
  
  ---
  
  ### Answer by username_3 on 2018-11-30. Score: 1
  
  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](https://i.sstatic.net/lrHRl.png)](https://i.sstatic.net/lrHRl.png)
  
  
  ---
  
  