Display User Input upon form submission

Sorry about that, first post in here. Please see below.

This is a custom form that I created, not a Wix-Box-Element. The multi-state box has 9 states, some have single questions with either radio buttons or checkboxes, some have more than one input elements (e.g. contact info as text input boxes). At the end of the 9th page, the submit button submits all the info to a collection.

The collection is connected to two databases: one is a write only database, and the other is a read only database, called database1 and database2 consecutively.

I used a bunch of code to make the form, but most of it works. The part I believe does not work is pasted below. I literally got it straight from Wix’s own Youtube:


    //DISPLAY INPUT
    function getData(){
        let query = wixData.query('Custom Pouch Form dataset');

        return query.limit(1000).find().then(results => {
            console.log('getData', results);
            return results.items;
        });
    }
$w.onReady(()=> {
    $w("#dataset1").onAfterSave(()=> {
        getData().then((items)=> {
            $w("#repeater1").data = items;
        });
    });
});

Below is a screenshot of the state that I’m trying to modify. (The “Thank you” state)

Right now I have two issues:

  1. As you see, the message on top shows: “Thank you Elma”, which is the name of the person that submitted the form previously, and not the most recent person that filled out the form. I’m trying to find a way to display the name of the most recent person that hits the submit button.

  2. I’m also trying to show the inputs of the most recent user in the table you see below. The problem is that it is showing the inputs of every single submission there has been done. How can I create a table that only shows the input of the exact person that filled out the form?

I hope this has been clear enough. If there’s anything unclear, please let me know. Thanks!