Is it possible to set the value of @price using a hidden field? | Community
Skip to main content
Question

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

  • February 20, 2022
  • 9 replies
  • 527 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!

Grace
Community Team
Forum|alt.badge.img+5
  • Community Advocate
  • February 21, 2022

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! 


LVRSNFRNDS
Forum|alt.badge.img

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • July 6, 2022

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!


LVRSNFRNDS
Forum|alt.badge.img

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). 

 

 


LVRSNFRNDS
Forum|alt.badge.img

Kind ping @Grace @Liz 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • July 11, 2022

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!

 


john.desborough
Forum|alt.badge.img+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


LVRSNFRNDS
Forum|alt.badge.img

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). 


LVRSNFRNDS
Forum|alt.badge.img

Reply