Dropdown and form input

Hi,
I have this page on my site that is a form input to my database Collection.

If I give Read and Write permission to this database Collection, when I get to this page, I get the latest data in each field of my form that was entered in the db. If I change something on the form and Submit, it does modify the data in the collection (db).

This is all fine but would like to be able to use a dropdown for the user to select the data record associated with the dropdown selection for all fields of the form and then modify and submit.

I was able to configure the dropdown button to show the list of items I want the user to choose from but can’t link it to every field of form (dataset) so it gathers the specific data for this dropdown selection.

How do I do this?

Attention
I am not trying to use a dropdown to select data on a repeater or a table but to gather the data for each field of my form based on the dropdown selection.

Thank you
Pierre Lacasse

1 Like

Hi,
what I really want, is a form dataset that input the collection to add records but that also extracts from a dropdown a specific already existing record in the collection and update some fields and reSubmit the updates to the Collection.

I need advice on how to do this!

The version that will add new records to the collection is already working fine. The form dataset is in Write Only so it will accept new entries.
If I change the dataset to Read and Write, I get the latest data in the form dataset fields

Just would like to select via a dropdown which record is visible on the form in order to have the possibility to update the Collection.

Thank you help would be much appreciated.

Hi @ibmretraitesqc , did you ever find a solution for this?

I am trying to do a similar thing with a form on my site. I would like to use the dropdown selection to populate the field labels and values of my form to match the data from the selected item. Then the form info to be submitted to a different database, based on the item selected.

I have already used the .getCurrentItem function for something else linked with the dropdown (see code below). So, I’m guessing it would be a matter of using this function to set the form fields and submit it to the correct database. Or am I wrong?

If anyone knows how to do this, I would really appreciate any help.

export function programSelectDropdown_change(event) {

    if ($w('#programSelectDropdown').value === 'Soccer') {
        $w('#soccerRegistrationBox').expand();
    } else {
        $w('#soccerRegistrationBox').collapse();
    }

    let itemObj = $w("#programsDataset").getCurrentItem();
    let programDate = itemObj.coedSpringStart
    console.log("program date:", programDate)

}