Creating a dropdown and a field populated from a sharepoint list


I am trying to create a dropdown and a second field that populate from a sharepoint list. I have code below that works to do this but i also need to get the value of the dropdown.

fd.spRendered(function() {

    //call function on from load
    fd.field('DropDown2').$on('change', populateCategories2);
    fd.field('Description2').$on('change', populateSpecDescription);
    });//rendered ends

    function populateCategories2() {

    //specify your site URL and which columns are selected
    var siteURL = '(SiteURL)';
    let web = new Web(siteURL);
    var selected = "";
    selected = "Title,Address";

    web.lists.getByTitle('(List Name)') {
        var valuesArray = [];
         // add data object to array
        allItems.forEach(function (element) {
            valuesArray.push({value: element.Spec_Description, text: element.Spec_IDandName});
           // set data source for dropdown
        fd.field('DropDown2').widget.setOptions({dataTextField: 'text', dataValueField: 'value'});  
        // reset fields
        fd.field('Description2').value = "";
    }function populateSpecDescription(){

    // set spec fields
    fd.field('Description2').value = fd.field('DropDown2').value;


Hello @Ckreuter,

Could you provide more information about your case so I can suggest a better option.

As for now, I don't understand why you need to populate the dropdown option every time the dropdown field value changes. What exactly do you want to design? Why don't you use a lookup field or lookup control?