Answers.Body: <p>Just adding to this -> this is now possible (since today: many thanks for Fuzion for re-asking this question and helping to see it through!); we had to relax a form_error that was preventing tokens to be injected in the default field for
  contribution_total_amount;</p>
  
  <p>You can now do: </p>
  
  <pre><code>/webform-civicrm-example?civicrm_1_contribution_1_contribution_total_amount=120
  </code></pre>
  
  <p>and if you have configured your Contribution Amount -> default as:</p>
  
  <pre><code>[current-page:query:civicrm_1_contribution_1_contribution_total_amount]
  </code></pre>
  
  <p>Then it will fetch that $120 -> and give you:</p>
  
  <p><a href="https://i.sstatic.net/mJLFg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mJLFg.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-05-01T15:37:34.090Z
Answers.LastActivityDate: 2018-05-01T20:08:15.940Z
Answers.LastEditDate: 2018-05-01T20:08:15.940Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>You can try to add the value in a URL to prefill it (if that is what you are asking). If the URL is: <code>/paymentform</code></p>
  
  <p>I think you could then send a URL such as <code>/paymentform?amount=25</code> with a default value in the amount field of <code>[current-page:query:amount]</code></p>
  
  <p><em>Aside:</em> If you are sending these URLs from a CiviMail mailing (or sending an email to a contact through CiviCRM) and have the amount information in a custom field, you could prefill the <code>amount</code> value in the URL <a href="https://civicrm.stackexchange.com/a/237/26">via a token</a> for that custom field value.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-28T21:16:37.270Z
Answers.LastActivityDate: 2016-03-28T21:16:37.270Z
Answers.LastEditDate: 2017-04-13T12:53:13.167Z
Answers.UserDisplayName: Laryn
Body: <p>A client is using webform-CiviCRM for a contribution page.  Due to pro-rating and other factors, each contributor needs to pay a unique amount - and thus the webform has the exposed "Contribution Amount" element that can accept an amount from a user.</p>
  
  <p>How can I pre-fill this Contribution Amount using a custom field value?  The webform Default Value can't be set to a token for a custom field that has the amount (returns "This is a CiviCRM currency field. Default value must be a number.", even if the field is an integer or a number.</p>
  
  <p>It might also be possible to attach the $ amount to the URL as a parameter?</p>
  
Tags: <webform-civicrm><contributions>
Title: Set the Webform-CiviCRM Contribution Amount to a parameter value
ThreadText: # Set the Webform-CiviCRM Contribution Amount to a parameter value
  
  (Asked by: username_0 on 2016-03-23)
  
  A client is using webform-CiviCRM for a contribution page. Due to pro-rating and other factors, each contributor needs to pay a unique amount - and thus the webform has the exposed "Contribution Amount" element that can accept an amount from a user.
  
  How can I pre-fill this Contribution Amount using a custom field value? The webform Default Value can't be set to a token for a custom field that has the amount (returns "This is a CiviCRM currency field. Default value must be a number.", even if the field is an integer or a number.
  
  It might also be possible to attach the $ amount to the URL as a parameter?
  
  **Tags:** webform-civicrm, contributions
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-05-01. Score: 3
  
  Just adding to this -> this is now possible (since today: many thanks for Fuzion for re-asking this question and helping to see it through!); we had to relax a form\_error that was preventing tokens to be injected in the default field for
  contribution\_total\_amount;
  
  You can now do:
  
  ```
  /webform-civicrm-example?civicrm_1_contribution_1_contribution_total_amount=120
  
  ```
  
  and if you have configured your Contribution Amount -> default as:
  
  ```
  [current-page:query:civicrm_1_contribution_1_contribution_total_amount]
  
  ```
  
  Then it will fetch that $120 -> and give you:
  
  [![enter image description here](https://i.sstatic.net/mJLFg.png)](https://i.sstatic.net/mJLFg.png)
  
  
  ---
  
  ### Answer by username_2 on 2016-03-28. Score: 2
  
  You can try to add the value in a URL to prefill it (if that is what you are asking). If the URL is: `/paymentform`
  
  I think you could then send a URL such as `/paymentform?amount=25` with a default value in the amount field of `[current-page:query:amount]`
  
  *Aside:* If you are sending these URLs from a CiviMail mailing (or sending an email to a contact through CiviCRM) and have the amount information in a custom field, you could prefill the `amount` value in the URL [via a token](https://civicrm.stackexchange.com/a/237/26) for that custom field value.
  
  
  ---
  
  