So we’re trying to set up a survey in which the user is presented with a landing page based on what information they have filled. Now there’s a feature of conditionals in the typeform itself, but I didn’t find anything that would let us attach a link to a page based on what user has submitted.
Another option is to evaluate the responses of the form after user submits it, but I didn’t find anything in the SDK documentation. The responses API is there for downloading all responses at once, but is there a way to get current response after form is filled?
Response API can retrieve specific responses by supplying included_response_ids parameter (if you supply just one ID, it will return only one specific response).
Response API can retrieve specific responses by supplying included_response_ids parameter (if you supply just one ID, it will return only one specific response).
I looked at your example and it looks like you are retrieving the response answers using the response_id and form id. However, is not entirely clear to me how you were able to retrieve the `response_id`, in the code it seems to be passed to the function specified in onSubmit(), is that correct?
const handleTypeformSubmit = async ({ responseId }) => {
const response = await fetch(`/api/response?formId=${formId}&responseId=${responseId}`)
if (response.ok) {
const { name, rating } = await response.json()
console.log(‘Form responses’, { name, rating })
// TODO: save name and rating in cookie // and use it to personalize the tooltip
}
}
id={formId}
chat
tooltip={getTooltip()}
key={`${typeformName}-${typeformRating}`}
onSubmit={handleTypeformSubmit}
hidden={{
visitor_name: typeformName,
visitor_rating: typeformRating === null ? ‘’ : (isTypeformRatingGood ? ‘good’ : ‘bad’),
I am running into one problem, when I have two typeforms to embed it stops working, as they both require the same parameters which run into a conflict:
I have everything set up correctly, but I have one more question. I want to track utm parameters and have set them up similarly to the hidden variables, like in the code below. However, I am not receiving utm parameters in the submissions of the forms. Is there another way I should go about passing the utm parameters?
Did you setup hidden fields in your typeform with utm_ prefix? If yes, then you need to name them accordingly in the tracking object (eg. not source but utm_source)..