Skip to main content
Question

How to convert a URL parameter to a number for use in the payment slide.

  • September 24, 2026
  • 4 replies
  • 22 views

How to convert a URL parameter to a number so that I can pass price into the Typeform for use in the payment slide. 

I need to do Part 1 - an application which calculates price based on user answers.  Then I want to be able to branch to 2 separate Typeforms using URL parameters to pass the price.  Then use a Stripe payment slide for one Typeform that I have branched to and a Paypal payment slide for the other Typeform that I have branched to. (Typeform doesn’t allow both types of payment slides in a single Typeform.)

However, URL parameters are passing data a character not numeric and I need to convert this calculated url passed price information from the original Typeform into numeric for use as price in the 2 branched to forms.

How can I convert a passed URL variable from character to numeric?

4 replies

carmentf
Community Team
  • Community Team
  • September 24, 2026

Hi there,

 

At the moment, you can’t convert a URL parameter from text into Typeform’s numeric Price variable within Typeform. URL parameters are passed in as data, and Typeform currently doesn’t support populating Score or Price variables through them. See Using URL parameters.

 

If you only have a limited set of possible prices, one workaround is to pass a text value such as plan_a or plan_b, then use logic in each receiving form to set its own Price variable accordingly. Typeform supports adding logic based on URL parameters, as described here.

 

For a fully dynamic amount calculated in the first form, you’ll need to handle the conversion and payment outside Typeform, for example with custom code or a payment workflow that creates the checkout amount externally. You can still pass information between forms using a redirect and URL parameters, but the receiving form won’t be able to use that passed value directly as its Price variable. More details are available in Pass information from one form to another.


  • Author
  • Explorer
  • September 25, 2026

Thank you!   

I have 14 different prices and each is now associated with a distinct character value when passed as a URL parameter.  The logic of going through each of the 14 values and then filling in the price using calculation logic rule is providing a solution. 

Although it works, it is a bit cumbersome.   It definitely works for now.  

 


carmentf
Community Team
  • Community Team
  • September 25, 2026

With 14 possible prices, building the logic can definitely be tricky, but I’m glad this workaround is doing the job for now. Thanks for sharing this approach, it may be helpful to others with a similar setup. 🙏


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • September 25, 2026

​@ltwitch - one possible option might be to ask the question about payment platform way up at the front, before the calculations start: ie  “This might seem strange to ask this here, but IF you want to apply, which payment platform would you use - Stripe or Paypal? (it helps us make the process a little smoother for YOU”

then based on their answer send them to the correct quiz/payment stream to answer the questions and then the price is available as the numeric. 

it does mean replicating the question streams but you can create one quiz, duplicate it and then replace the payment screen. 

just a thought to avoid passing the text parameters (and hoping there is no price change along the journey) 

 

des