Question

Is it possible to set the value of @price using a hidden field?

  • 20 February 2022
  • 9 replies
  • 421 views

We require our clients to pay a deposit on certain services (usually 50%) up front in order to ensure clients are committed to their projects. Obviously, this number varies from project to project.

I’m creating an onboarding form and wondering if it’s possible to set the value of @price in a Payment question via a Hidden Field.

So far, it seems like Hidden Fields are strings by default. Is there a way to change that? Based on this thread, it seems there once was on option to evaluate Hidden Fields as numbers, but I don’t have that option (see screenshot).

 

I was hoping I could pass along something via url like

https://example.typeform.com/to/nzthWI#deposit=1000

Then use logic to add the value of @deposit to @price to dynamically update the client’s total.

Is this possible with Typeform? Or maybe another approach I’m overlooking, like directly manipulating @price from the URL?

Thanks so much for your help!


9 replies

Userlevel 7
Badge +5

Hey @stewartcrew thanks for stopping by, and great question! 

Right now it’s not possible to set up logic to add values to hidden fields. It’s only possible to pass the value from this form to another by recalling @price to the hidden field in the form URL:

Not sure if this would work for what you’re trying to do, but let me know if you have any other questions or thoughts on workarounds! 

Userlevel 1
Badge

Thanks @Grace ! Not sure your solution is working with my example: https://lvrsnfrnds.typeform.com/to/yxgTn9Sg?typeform-source=lvrsnfrnds.typeform.com#price_hf=400

Userlevel 7
Badge +5

Hi @LVRSNFRNDS Can you share a screenshot of how you have the pricing field set up and the logic jumps you’re using to pass that information into the payment question? Thanks!

Userlevel 1
Badge

Thanks @Liz ! I don’t have any logic jumps as @Grace suggested to add a redirection to the payment form at the end of the first form (see attachement). 

 

 

Userlevel 1
Badge

Kind ping @Grace @Liz 

Userlevel 7
Badge +5

Got it, thanks @LVRSNFRNDS ! I gave this a test and asked some folks internally about this, and I believe it’s not possible to pass in the price through a hidden field into the payment question. 

I could be missing a workaround solution that @john.desborough knows of!

 

Userlevel 7
Badge +6

@Liz @LVRSNFRNDS -  a couple of times i have created a variable called iprice and passed that as a hidden variable into another form and used logic rule to add iprice to price

 

for my example, iprice would be the answer choice from your multiple choice with the logic rules like this

  • if q1 = A then replace iprice with A
  • etc… 

then in the payment question/form, have iprice as hidden variable and start the logic with the rules that assigns the numeric value to the price variable - i had to do it this way as the variables are passed as strings and not numeric

that works for me.. might work for you.. 

des

Userlevel 1
Badge

thanks a lot @john.desborough ! is there a way to make this work with a free amount (using the ‘other’ field in the multiple choice). 

Userlevel 1
Badge

Also, @john.desborough  for the first form should the URL look like this: https://xxxx.typeform.com/to/xxxx#price_hf=xxxx or https://xxxx.typeform.com/to/xxxx#iprice=xxxx ?

Reply