Skip to main content

We have a requirement that if a user submits multiple times in a day, only the most recent response for that day should be saved. In the typeform, on Submit, how can we add logic to find existing responses for the same user (let’s say a user is identified by first name and last name fields) on the same day and delete them first, before saving the current response?

The solution for the above will also help solve another requirement (say) to restrict only one response (the latest) per user per quarter.

@jervin31 - this workaround may not be what you want to try but it does the job for several of my clients. 

  • connect your typeform to a Google Sheet. 
  • create a ‘reporting’ tab and pull all the data from the main (typeform dump) tab into this one
  • set up the filters/run a macro in the Google Sheet to show only the most recent response by the user. 

there are some new features just announced about limiting entry ie duplicates but it may not meet your use case. 

 

i have clients where we do monthly inputs from teams across the organization, and we do a bunch of trend analysis as well (ie period over period) but in the one form, main report we only publish the latest inputs per team using this method. 

 

cheers

des


Thanks, @john.desborough , can the Typeform have the below functionality

Let’s say there’s a stage (not UI) where the developer can define the key field(s) and date range

Multiple fields can be used to define a key such as a combination of first_name and last_name

Let’s say, I defined 

lookup_keys = @email_id

from_date = ‘2024-03-01’

to_date = ‘2024’-08-01’

lookup_date = @submit_date

 

Here, the lookup_keys, from_date, to_date and lookup_date are new system fields to hold values, which can be reference to user defined field names or actual values

On form ‘Submit’, the typeform engine should do the below

  1. Look up all existing records where lookup_keys match the current form values and lookup_date is between from_date and to_date.
  1. Delete the above matching records
  2. Save the current form fields

I think the above logic would let the developer defined if they want to keep only the latest response for a user based for a day or per quarter or any date range.

The above functionality would avoid or minimize for the developer to write macros or manual post processing of generated google sheets.

Plus the above functionality would clean the data residing in the typeform tables, the SOR. If we did manual editing (or macros) on the google sheets alone, then the view on the Results page of the Typeform will not match with the cleansed google sheet.

 


Reply