Hi
does anyone know how to populate a drop down box from a calculated field generated by a hook?
Example: i have a hook running that takes the first and last name of members and joins them as a full name which is working fine.
However in a form i have i want my drop down box to populate from this full name field but you can’t connect it via the six way as you cannot see the calculated fields in the datasets.
I’m pretty good at working with calculated fields to generate in a normal text box in my form but i cannot seem to get the drop down to work. here’s the code I’m using right now hoping that it would use drop down to show full names then once selected put the associated email address of that member into my text box.
$w.onReady( function () {
$w(“#dietsDataset”).onAfterSave(sendFormData);
$w(“#memberProfile5”).onReady(() => {
populateCalculatedFields();
} );
$w(“#memberProfile5”).onCurrentIndexChanged( (index) => {
populateCalculatedFields();
} );
} );
function populateCalculatedFields() {
const currentItem = $w(“#memberProfile5”).getCurrentItem();
$w(“#fullName”).value = currentItem.fullName;
}
export function fullName_change(){
if ($w(“#emailAddress”).collapsed) {
$w(“#emailAddress”).expand();
}
let dropdownvalue = $w(‘#fullName’).value;
$w(‘#memberProfileemaill’).setFilter(wixData.filter().eq(“fullName”, dropdownvalue))
$w(‘#memberProfilefirstname’).setFilter(wixData.filter().eq(“fullName”, dropdownvalue))
}
hoping someone can help.