Skip to main content
Answered

Transform dropdown text answer into matched URL for use in Zapier

  • 4 August 2021
  • 5 replies
  • 63 views

I’m trying to work out a way that I can transform text based dropdown answers in Typeform into an associated URL that I can use within Zapier, to send to another service.

Basically I have a list of 450 text answers in a dropdown and each will have an associated image file that I want to pass into another tool.

Is there any way for me to create this matched list within Typeform? e.g.

 

Dropdown Question
Answer 1 what the user sees] → Transformed to: https://URL.com/image1.png
Answer 2 ewhat the user sees] → Transformed to: https://URL.com/image2.png
Answer 3 swhat the user sees] → Transformed to: https://URL.com/image3.png

 

It unfortunately would not make sense for the user to see the URL and pick that instead of the text based answer.

If it is not possible to transform the answers into URLs in Typeform, any thoughts on the easiest way I might do it within Zapier or with another service?

@JosephS - from another user, who welcomes you to the community 

you COULD do this with the advanced logic area by creating a text variable, say v_imageurl and then populating it based on the selection 

  • if q1 answer is A replace v_imageurl with ‘https://yaddayadda’ 
  • if q1 answer is B replace … 

it would mean setting up the 450 logic rules - that is a bit of work but easy enough to do with sufficient coffee at hand - and then you can send the value to the other service by mapping the variable to the target field in the other service or adding it as a hidden field, depending on the method of integration to the downstream service

 

just a thought

 

des


Thanks for the welcome @john.desborough, that does make perfect sense. Unfortunately there is actually 5 questions, all with the same 450 answers and so that would create the need for 2250 logic rules, i.e. with 5 text variables (one for each question). It is a solution I hadn’t thought of though and if there isn’t other forthcoming ideas that make it simpler, I will look at giving that a try :relaxed:


@JosephS - at least you could create the logic for the first question then duplicate the question to short cut the creation of the logic rules for each, though you will have to edit the ‘replace with’ text with the different url strings (assuming that they are different for each of the 5 questions 

might save a little time.. but..  feel your pain!

des


 @john.desborough, good to know duplicating the question will duplicate the logic behind it. That is super helpful to know. All the URLs will be the same, so just be a matter of updating the text variable on each. Thanks again!


Trying to think about a way to make this generic so you don’t have to create a rule for each option.
Are you the owner of the images and do you control where they are hosted?
Because you could probably rename those so it fits the same format to be:

http://server.com/{answer to question}.png

It takes a bit of time of rewriting the file names, but at least it simplifies the logic.

Otherwise in Zapier you use a code flow that could look like this (I have not tested it)

let images = {
'answer to question 1': "https://server.com/image1.png",
'answer to question 2': "https://server.com/image2.png"
...
}

let finalImgURL = imagesgtypeform_response]

And it’s in this code block that you link things together.


Reply