Repeater that adds form elements based on user input

I’d love some likes to get this to the top.

I am trying to code for a page and I’m running into some issues.

I’m looking to create a page where someone lists a number of people they’d like to send an invite to, and then it populates that many forms with a name and email input.

Code is below, please let me know if I’m going about this in the wrong way.

export function dropdown1_change(event) {
coun = 0;
let d = $w(‘#dropdown1’).value;
Data = ;
while (coun < d) {
$w(“#repeater1”).onItemReady(($item) => {
Data = [{
“_id”: $w(‘#numberset’).getItems(coun)._id,
“value”: coun
}]
let tempData = $w(“#repeater1”).data;
$w(“#repeater1”).data = tempData.concat(Data);

        coun = coun + 1; 
    }) 
} 

}