How to enter a different value of a dropdown into a dataset?

Hi,

I have set up a page that allows a user to select an email campaign from a drop down and then send it to a specified recipient. The form data then gets saved to a dataset. However, to enable my email functionality to work I have set the value of the dropdown items to be the templateID so that the correct email template gets sent. Is there a way to save the ‘label’ name into the dataset rather than the value?

eg. save ‘Email Campaign 1’ instead of ‘d-XXXXXXXXXXXXXXXXXXX’

Thanks,
Rachel

Ok, so I’ve managed to use a workaround…

let emailCampaignName = "" 

if ($w('#ddEmailCampaign').value === "d-xxxxxxxxxx1") {         emailCampaignName = "Introductory Email" 
} 
else if ($w('#ddEmailCampaign').value === "d-xxxxxxxxxx2") {         emailCampaignName = "Follow Up Email" 
}

But moving forward I will be adding further email campaigns so it would be great to know if there is an easier solution that won’t require manually adding the templateID and campaign name to the code :slight_smile: