Is there a recommended way of storing dynamic form data within a Quickbase table?

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • In Progress
  • (Edited)
Hi there,

I am working on a development project where we are looking to store form data submitted via a website into a Quickbase table. There will be multiple forms which share a set of pre-defined fields but will then have a set of 4 or 5 additional questions fields that vary from one another, for example:

Form 1:
First Name (text)
Last Name (text)
Email Address (email)
Date of Birth (date)
Which sports do you play out of the following? Rugby, Football, Cricket, Golf (multi-select)

Form 2: 
First Name (text)
Last Name (text)
Email Address (email)
Date of Birth (date)
How many days a month do you exercise? (number)

We will not know what these questions are in advance as the client will be able to add these questions dynamically per page and so pre-defined columns aren't an option.

We have managed to create a user token and successfully post data for the predefined fields via the api and store it in the table, however, we were wondering if there was a way to dynamically create new fields based on the data that is passed to the api, almost like a key value store, as opposed to having to predefine columns such as 'Question 1', 'Answer 1', Question 2', Answer 2'.

Any help or suggested ways of handling the dynamic forms would be much appreciated.

Kind regards,

Nick
Photo of Nicholas Fish

Nicholas Fish

  • 110 Points 100 badge 2x thumb

Posted 6 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,522 Points 50k badge 2x thumb
I suggest considering a Parent Child structure. The Children can either be all the questions or the additional questions, the child table for questions would have a field for the Question and another field for the Answer.
Photo of Nicholas Fish

Nicholas Fish

  • 110 Points 100 badge 2x thumb
Thanks for your response. Are there any guides or tutorials on how to set up such as structure? I am new to Quickbase and so any further pointers would be appreciated.

How would we link the questions and answers to the parent entry?

Thanks
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,522 Points 50k badge 2x thumb
Here is some help on setting up a Relationship.
https://help.quickbase.com/user-assistance/creating_a_relationship.html

The website process would need to create a Parent record with header info like name or whatever is common to the survey questions.  If you are working with a web person, they can use an API to do that and it will respond with the [Record ID3] of the newly created Parent record.  Then the website process would need to create the child questions records and populate the field called [Related Parent] with the [Record ID#] of the newly created Parent.  
Photo of Nicholas Fish

Nicholas Fish

  • 110 Points 100 badge 2x thumb
I've just been out for a walk and this popped into my mind, thanks very much for clarifying. I've already been playing about with the api and so will experiment further with this setup; your help is much appreciated.

Is it relatively easy to pull through related data from one table to another whilst staying on the same screen in the Quickbase admin?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,522 Points 50k badge 2x thumb
It is extremely easy to bring down any look up fields from a parent down to child records. It is also extremely easy to summarize up and ate a numerical type data from child records up to parents.

Once you have set up a relationship there are buttons to do either one of those set ups.
Photo of Nicholas Fish

Nicholas Fish

  • 110 Points 100 badge 2x thumb
Thank you, I'll have a play about and let you know how I get on. Thanks for the pointers.
Photo of Nicholas Fish

Nicholas Fish

  • 110 Points 100 badge 2x thumb
That appears to have worked extremely well and is just what I was looking for, so thanks for that. The next step I guess is finding the best way to add multiple records to the api in one call? Is this possible? So, for example, one registration may have 10 records that need adding in the questions table. Do you have any examples or experience of this?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,044 Points 20k badge 2x thumb
>... add multiple records to the api in one call? 

API_ImportFromCSV
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,290 Points 50k badge 2x thumb
Yes, I agree with Dan.  The API guide is here for your web person.

https://help.quickbase.com/user-assistance/apicalls.html
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,044 Points 20k badge 2x thumb
What is a "web person"? Does a "web person" need mad skills as demonstrated below?

http://webperson.com/
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,290 Points 50k badge 2x thumb
In my head I was saying "web guy", but I thought that would be a sexist assumption so I was trying to be PC .