2+ Contact Forms, Multiple Submissions & Message History

Hi,

Is there any way I can keep a communications history using custom forms and databases PER EACH UNIQUE EMAIL address? So for example, my user ends up arriving on landing page today, sends me a message along with their name and email addy. Then, tomorrow, they come again and have not heard back and want to send a 2nd follow up message through the form.

How can I go about making the form and database NOT overwrite the 1st message and instead record each message into a separate column?

This is going to involve a scenario that the user may use the same contact form as before or a different one on a different page that is essentially connected to the same database.

I am not sure if I can make this clear enough, but I hope you can see the hypothetical problem here.

I was about to go ahead and replace all my contact forms with a custom made one since I was told regular contact forms do not currently record to a database. But then the more I think about it the more I run into certain scenarios and challenges that just make this seem like a lot of work for somewhat less than highly desirable results in the end that I am seeking to achieve. I am trying to make my client’s life easier and with FEWER emails and duplicate dbs, environments, back-ends, etc that he has to constantly interact with… if I can get a dashboard or database to do what I want it to do. Currently, from what I have read and know which may be incomplete, it seems this is impossible under one roof of Wix :frowning:

I have already submitted an extensive feedback form about these matters as well just moments ago, but wanted to specifically ask this question here and find out all I can about this stuff with current possibilities here as well.

Thanks

Hay Omid,

The Wix Code forms, by default, write a new row in the database on each submission. This means, that if a customer comes back tomorrow and submits again, you will have two rows with the same email, from the same person.

If you want to do something more, you can do quite a lot -

You can check, using code, if the user has already submitted something with the same email, and decide to update the same submission or create a new one marked as secondary.

You can store the first submission using local storage (on the device in use) and use that on the second day.

Depending on what is the expected behavior you envision, you can probably compose it using Wix Code.

hmmm, aright, that is very encouraging to hear. Can you tell me if that would require custom js programming and then connecting it to Code via files? or are there Wix-exclusive syntax for it?

Specifically, I would love to keep 1 line of data, and create additional entries on that row per each time that unique email sends something in. Without necessarily rewriting any fields, just add a new text field/column. Do I need to have the columns made and associated beforehand or can they be created dynamically and as needed in the database via the submissions?

Just a little guidance will really help get me in the right direction plz and I will try to play with the rest and find my way to my final goal. But then again don’t hold your mercy on me :slight_smile:

Thanks

Hay Omid,

In this case you will need to write JS code to search for an existing item in the database, and if it does exist load it, update it and save it again.

You can do so in the beforeSave hook. Just make sure to return a Promise.reject to prevent the dataset from saving the form by itself.