I have a drop down that is not mapped to the data source since the field being used is sometimes not defined.
I try have tried to use a lot of different techniques to set the value in the dropdown and all that is happening is that the default selection is always being set.
The trigger to populate the form where the select object is located attempts to set the value in the Success event handler.
I send the select item to the console log before and after the script has attempted to set the selection.
Here is what the select control looks like
This is how each of the drop down selection is setup
This is the code in the Success event handler
not_found.setHidden(true);
console.log("UID: ", button1ClickHandler.data[0].uid);
console.log("email: ", button1ClickHandler.data[0].email)
console.log("isTrusted: ", button1ClickHandler.data[0].isTrusted)
console.log("form: ", form1);
console.log("select: ", select1);
if (button1ClickHandler.data[0].isTrusted === true)
{
console.log("Found Trusted");
select1.selectedIndex = 0
select1.selectedItem = select1.data[0]
select1.setValue("Trusted");
select1.value = "Trusted";
select1.label = "Trusted";
select1.resetValue("Trusted");
}
else if (button1ClickHandler.data[0].isTrusted === false)
{
console.log("Found Not Trusted");
select1.setValue("Not Trusted");
select1.selectedIndex = 1
select1.selectedItem = select1.data[1]
select1.value = "Not Trusted";
select1.label = "Not Trusted";
select1.resetValue("Not Trusted");
}
else {
console.log("Found undef");
select1.setValue("Undefined");
select1.selectedIndex = 2
select1.selectedItem = select1.data[2]
select1.value = "Undefined";
select1.label = "Undefined";
select1.resetValue("Undefined");
}
console.log("select: ", select1);
As you can see I am attempting to use basically everything. I had tried each individually too with the same result the Undefined option always is selected.
The console log for the select1 control before making any changes has the following information, I needed to do two screenshots for the object
After the script runs and the select object has been altered the object now looks like the following again two screenshots.

Hope this is enough information for some one to tell me why the select dropdown is not showing the proper value
I commented out the resetValue method and this did not change the outcome