Dropdown Items not updating after .refresh()

Could use some help with this. Bottom line, my items in the dropdown list do not update after an item has been submitted to a database, without a page reload (would like to try and do this without having to reload the page). Basically what I’m trying to do is create 2 forms on the same page. First form is used to “add a show” with (info, etc) and that’s submitted to database 1. The Second form I want to be able to select a show from database 1 to a time slot (using a drop down list). The catch is, the second form must have an item added to Database 1, before it can show up in the dropdown list to select. That is because I am using a reference field to pull in all the show info along with the show name.

I’ve attached a photo of what I’m trying to build, design and layout not final. Just playing around with all the elements and connections. I finally was able to get the reference field to work!!!

Thanks in advance,
Jeff

Hello Jeff.

You need to add two datasets to your page, one for data submission and one for data display, then use onAfterSave data hook to refresh the display dataset automatically. See sample code below:

$w.onReady(function () {
    $w("#submitDataset").onAfterSave(() => {
 // after the save is completed on the submitDataset,
 // refresh the displayDataset which will refresh the connected repeater
        $w('#displayDataset').refresh();
    });
});

Remember to replace the dataset IDs with your own.

Good luck!