I don't think that there is any default option to get unselected values from the choice fields or lookup fields.
I can give this as possible workaround for your usecase.
Case 1 - Lookup Field
I guess input.Trainees_Present
is multi select look up field. So you are storing selected values r.Intern_No
in list.
You can iterate overall values from backend form.
unselectedList = List();
for each trainee in Trainee_Form[<Give Criteria if you have any filter for lookup field>]
{
if(variable.contains(trainee.Intern_No) == false)
{
unselectedList.add(trainee.Intern_No);
}
}
input.TraineeMul:ui.add(unselectedList);
Case 2 - Choice Field - Solution 1
We have to store the choice fields in some other functions, we have to append all choices in OnLoad Script
.
Since we have stored total list in one function, we can get unselected list by removing selected items from total list.
Case 2 - Choice Field - Solution 2
Zoho Creator provides as API to fetch form fields. We able to get the choices list from the response.
Link to the Documentation: https://www.zoho.com/creator/help/api/v2/get-fields.html