Answered

Possibilities for complex calculations


Userlevel 1
Badge

Dear Typeform community,

 

For a personal project I want to create and app-like form, with complex calculations behind the scene.

I know it’s possible to add logic, calculations and hidden fields to the forms. However, I was wondering if it is also possible to run javascript code or something like that. I was looking at the following features:

  • Auto-complete an adress
  • Make calculations based on given dates (calculate time difference given date and current date)
  • Request information from an api based on given adress
  • Store information behind the form in a key-value like fashion (or a good workaround in hidden variables)

I think I can get very far with typeform, but I’m a bit worried about the request data from an api part and the date calculations, which should be doable if it is possible to run some javascript. However, I found this post which says it is not possible.

Does anyone know whether these features are achievable? Or should I try to make something simpler.

icon

Best answer by mathio 26 May 2022, 14:28

View original

7 replies

Userlevel 7
Badge +5

Hello @Jver 

I am afraid it is not possible to run custom JavaScript code inside your typeform.

Userlevel 1
Badge

Is it possible to make a date calculation? Just a simple ‘the filled in date is before date x’. This way I add a pre-form section on a website which requests date x based on the current date and some other arguments and passes it to the typeform.

Userlevel 7
Badge +5

Hi @Jver We don’t have this feature in our forms, but I can share this suggestion with our product team!

Userlevel 5
Badge +5

It is actually possible to execute Javascript code on a Typeform using the Google Tag Manager integration, for users with a Business Plan or above.

Userlevel 7
Badge +5

Thanks, @jeremielp ! I do want to note that this isn’t something we support, so if a user decides to use GTM to add custom code and something happens with the form, we are unable to assist. 

Hi Liz,

Any info if the development team is working on the feature to add more complex calculations? I desperately need to calculate the diff between two dates and do calculations based on this. So for this client I missing the opportunity to implement typeform.

Userlevel 7
Badge +5

Hi @BM7 Nothing that I’m aware of at the moment, but as always, if that changes, I’ll post an update here. 

Reply