I'd like to use JavaScript in the Modern Form Designer to split a single line dropdown value from 1111|2222|3333 to multiple lines in the dropdown using the | as a pipe to separate the values. Since we are using LF Forms Essentials we are not able to use lookups to set dropdown values. I am using Workflow instead to set the value, but as far as I know Workflow can only set a single line in a dropdown.
I found the following code for the Classic Form Designer. Does anyone know how to apply this to the Modern Form Designer? Our LF Forms has been updated to include Inline/External JavaScript.
$(document).ready(function () {
//Compile correct list of Owners in "Person Making Request Field"
//Loop through all options in the drop-down list.
var options = $('.List_of_Owners option:first-child').text().split('|');
var index;
for (index=0; index<options.length; index++) {
$('.List_of_Owners select.form-item-field').append("<option>"+options[index]+"</option>");
}
$('.List_of_Owners option:first-child').remove();
$("<option>", { value: '', selected: true }).prependTo(".List_of_Owners select.form-item-field");
//Prepend a blank option to the field
$("<option>", { value: '', selected: true }).prependTo(".List_of_Owners select.form-item-field");
});