The CreatorCon Call for Content is officially open! Get started here.

Blank option on a variable

John Vo1
Tera Guru

Is there a reason why I have a blank option for one of my variable on this catalog item?

find_real_file.png

Is there something in my script that can cause this?

find_real_file.png\

I also have Read Only as a choice under this variable.

1 ACCEPTED SOLUTION

Try this:

function onChange(control, oldValue, newValue, isLoading) {
	if (isLoading || newValue === '') {
		return;
	}
	var test = g_form.getValue('access_needed'); //Change accordingly
	
	g_form.clearOptions('type_of_access');
	
	if(test == 'flowcal mlp'){  //Change accordingly
		g_form.removeOption('type_of_access', 'read only');
        g_form.addOption('type_of_access', 'edit','Edit');
		
	}
	else
		{
        g_form.addOption('type_of_access', 'edit','Edit');
		g_form.addOption('type_of_access', 'read only', 'Read Only' );
	}
}

Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

15 REPLIES 15

My bad Updated script here

function onChange(control, oldValue, newValue, isLoading) {
	if (isLoading || newValue === '') {
		return;
	}
	var test = g_form.getValue('access_needed'); //Change accordingly
	
	g_form.clearOptions('type_of_access');
	
	if(test == 'flowcal mlp'){  //Change accordingly
                g_form.addOption('type_of_access', 'edit');
		g_form.removeOption('type_of_access', 'read Only');
	}
	else
		{
                g_form.addOption('type_of_access', 'edit');
		g_form.addOption('type_of_access', 'read only');
	}
}

Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Prateek,

 

This script hides choices for Type of Access for either flowcal legacy or mlp.

 

Thanks,

John

Can you please post a screenshot of choice values of access_needed variable and type_of_access variable?

As per your reply it says blp  (flowcal legacy or mlp) but as per the script it says flowcal mlp.


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Prateek,

 

So when Legacy is selected only Read Only and Edit needs to be available.  Right now it's blank.

find_real_file.png

find_real_file.png

Same with MLP.  

Also if MLP is selected only Edit needs to be available.