Answered

Store Old-New Relations Between Hidden Fields and Answers

  • 25 October 2022
  • 6 replies
  • 112 views

Hey y’all,

 

I’m using Typeform as a method for our users to update their personal information. Using hidden fields, I am able to display their current (old) information, then users can branch to questions where they can input (new) information, if it has changed. E.g.:

Q1: “Is still your mobile number: {hidden_field_mobile}?”
A1: “No.”

Q2: “Please enter your current mobile number.”
A2: [a short text input]

In essence, I want to create an old-new relationship between values stored in hidden fields and answers to questions related to the hidden fields.

 

We have an endpoint that parses the request sent by the webhook; there, using an association between answers and hidden fields, I would like to see the difference between the old and new inputs so we can display it to administrators of the system.

Here are my attempts at creating these associations:

  1. My initial idea was to set variables, with the same names as the hidden field, and assign to them the answer of select questions (within the Typeform), but I haven’t found a way to do that.  This would allow me to compare the values with identical keys across the “hidden” (old values) and “variables” (new values) objects in the webhook request.
     
  2. Alternatively, I thought of setting a variable (using the same naming scheme as above) to the question identifier when it is answered, then, through more parsing of the webhook request, I could create an association between the hidden field (old) value and the answer to a question (new) via this variable.
     
  3. The one solution I have that works (technically, albeit it is absolutely disgusting) is to set a variable (again, named like above) to a static string that’s the same as the question name, to use as a pseudo-identifier (within the scope of the form). However, this makes the form much more difficult to maintain, and is a much weaker association.

Is there a precise way to associate hidden fields with answers?


Let me know if anything is unclear! Cheers 🍻

Isaac


Related information:
The guide found here (https://www.typeform.com/help/a/add-scores-and-calculations-to-your-typeforms-360054424131/) says you can add to or divide by the answer of a question, but I wasn’t able to in the Typeform I spun up. Is this a premium feature?

I found this forum post (https://community.typeform.com/build-your-typeform-7/how-to-assign-question-answer-to-a-variable-5653) but it’s interested in concatenating answers, and provides tools that can perform the concatenation.

There’s also this fourm post (https://community.typeform.com/typeform-developers-44/storing-arbitrary-meta-form-information-3933) about storing arbitrary meta-information, which is not possible.

icon

Best answer by john.desborough 26 October 2022, 18:20

View original

6 replies

Userlevel 7
Badge +5

Oofta! I’m not sure if this would be possible outside of what you’ve already tried, but @mathio or @john.desborough might have some insight for you. 

Userlevel 7
Badge +6

@Liz @robertxisaac  - what i have done for other clients is to use it as a confirmation entry rather than ask for any changes. 

ie from the crm, attach all the fields i want to have them validate using the name/value structure like this: c_email={{subscriber.email}} and c_cellphone={{subscriber.cellphone}} - your crm may use different structures to append the values but this is an example. 

i use the c_ nomenclature here to identify to me that these are the ‘current’ values

in the typeform i create the corresponding hidden variables as c_ as well. 

in the questions: “In order to validate that we have the correct information on file, we ask you to input the current/correct values for the information we have about you” 

  • Here is what we have for your current email address: @c_email 
    • Please enter your email below to validate or correct the email we have on hand. 
  • etc

that way all the fields - current and (potentially) updated - are entered and passed back to the next phase 

unfortunately you will have to evaluations of the strings being passed back to you from Typeform and parse and update as necessary.. or just accept that the new data is the correct data to push into the crm record. 

ain’t perfect but …

 

des

@Liz@john.desborough - thanks for the replies!

Some further context I could have provided: the “CRM” I’m using is PHP, so I can do just about anything upon receiving the webhook request (except create arbitrary relations between strings, unfortunately).

We’re following the “confirm or update” scheme you described @john.desborough, and you’re right on: I’m able to parse through the objects for the hidden fields and answers. When you say you push the data into your CRM, how do you assign the answer from “Please enter your email below to validate or correct the email we have on hand” to “subscriber.email”, and other answers to your other CRM variables? Or, is it a manual process you have to do yourself?

Another solution I implemented is to parse for questions with free-form text inputs (i.e., where their type is “long_text”, “phonenumber”, etc.), and pull answers related to those. However, it’s still trying to guess what’s important and definitely the weakest of the solutions I’ve attempted.

 

Cheers 🍻

Isaac

Userlevel 7
Badge +6

@robertxisaac with the native integrations to most CRM systems or by using Zapier or Make you can map your questions to fields in the target platform

if you are working with the APIs and Webhooks, you should review the developer materials if you haven’t already.. 

 

 

Hey y’all,

 

It’s been a year. Can anyone give a quick yes/no if a similar feature has been implemented? We’d like to use Typeform for our upcoming rollout, and the current implementation requires a ton of hand-holding.

 

Cheers 🍻

Isaac

Userlevel 7
Badge +5

Hi @robertxisaac great to see you back here, thanks for checking in! 

As far as I’m aware, this hasn’t made it into Typeform yet but I can check in with the product team to find out if there are any plans for updates around hidden fields for 2024 and let you know 😊

Reply