Forum Discussion

NicholasFish's avatar
NicholasFish
Qrew Trainee
7 years ago

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

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
  • 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.
  • 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
  • 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.  
  • 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?
  • 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.
  • Thank you, I'll have a play about and let you know how I get on. Thanks for the pointers.
  • 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?