Answered

Retrieving values based upon responses

  • 14 November 2023
  • 8 replies
  • 288 views

I am creating a form where users sell used items to our company for resale. I have an external table in a Google Sheets spreadsheet with approximately 250 items. The idea is that the user will enter their item name and receive a quote, with the quote price coming from the table.

Three questions:

  1. Is it possible to create a conditional dropdown in Typeform? E.g. user selects Brand and is presented with various models and then based upon model selected can chose size.
  2. Based upon the selection made in question one, a result (price) is retrieved from Google Sheets. Can this be done?
  3. Can then a calculation be made using the retrieved value? E.g. If the customer select Excelent, Fair, Bad as conditions, that the price would then be adjusted.


Thanks in advance.

icon

Best answer by mathio 14 November 2023, 23:20

View original

8 replies

Userlevel 7
Badge +5

Hi @phil_pharos Thanks for stopping by the community! I hope you’re having a lovely week so far. 

To answer your questions, 

  1. This is possible, but it is a bit of a setup. Essentially, you would need to create as many possible combinations of this as possible and then use this setup for logic jumps to show the corresponding one. 
  2. It isn’t possible to obtain data from an outside source. All of the data needs to be set within the form. 
  3. You can definitely adjust calculations based on selections. Our article here can help you get started using calculations. 

Hopefully this helps you get started! Let us know if you have any other questions. 

Hi Liz - appreciate the quick feedback. I thought it might be a lot of work to setup. We currently have a solution that is built in PHP/MySQL. I.E: web interface with a database at the backend. The solution is messy and we will replace it. What we do is buy used cell phones from the private market. So the customer enters the site, selects their phone using 3 dropdowns and which then pulls the base value for the cell phone. The customer/seller then answers a few basic questions which then may reduce the base value. Once completed, the customer then fills out a registration form. My ‘logic’ and thought behind this was that maybe Typeform could be a good backup replacement solution. As I am understanding it Typeform has no ability to query a database or Google Sheet and thus I would have to use Typeform logic jumps to do this.
I will take a look at your ‘this setup’. With 250+ cell phones it could be quite a bit of work.

Again, thanks for your feedback.

Regards

Phil

Userlevel 7
Badge +5

Oh gosh, yes, that would be quite a bit of work, @phil_pharos . @mathio or @picsoung might have a workaround for you using the APIs, but I’m not 100% sure on that. 

Userlevel 7
Badge +5

I think you might be able to achieve this by connecting 2 typeforms:

  1. create 1st form
    1. customer will select product from a dropdown (you can copy-paste values from your spreadsheet)
    2. they will also select condition eg. from multiple choice question
    3. on submit they will be redirected to custom page
  2. custom page
    1. it can receive responses from 1st form as query params in URL
    2. it will lookup the price in database
    3. it will redirect to 2nd form with price as hidden field as query param in URL
  3. 2nd form
    1. it will display the price based on hidden field
    2. you can pass product details and condition as hidden fields too
    3. you can collect user details here

I hope this helps.

Hi Mathio - appreciate the response and idea. I am going to start on this project, hopefully early next week. I will only set up a few products/mobiles to start up with. In terms of setting up the custom page, is there any documentation available that can assist here?

Regards

Phil

Userlevel 7
Badge +5

From our side, you can see this help article on redirect with variables:
https://www.typeform.com/help/a/use-variables-in-redirect-links-4414707303700/

In case you are using Google Sheets, you can use https://sheetdb.io/ to retrieve data from your spreadsheet, They provide a simple service that might fit your needs. If you are looking for code examples, I have recently implemented their API in JavaScript in an unrelated case, but you can reuse most of my code - see the example here.

Userlevel 7
Badge +5

I built an example of a similar use case here: 

https://mathio.github.io/typeform-embed/html/retrieve-from-google-sheet.html

Feel free to reuse whatever you can, if it helps.

Userlevel 7
Badge +6

very cool @mathio 

Reply