UNGRAY Instruction

The UNGRAY instruction re-enables the previously grayed component you specify, allowing the template user to interact with the component.

The UNGRAY instruction is only available when you are creating a dialog script in the Script tab of the dialog editor.

After you use the GRAY or GRAY ALL instruction to stop the template user from interacting with a component, you may need to later ungray a variable on the dialog. For example, when the template user meets a required condition and the previously grayed variables are now relevant.

Instruction name Model After you drag and drop the model into the script tab:
UNGRAY UNGRAY ⟦VAR⟧ Replace ⟦VAR⟧ with the variable in the dialog that you want to ungray and enable the template user to answer.

Example

While creating a tax form, the template author only needs the end-user to enter their country of residence if it is outside of the continental United States. They have a dialog containing two variables:

OutsideUS – A True/False variable which asks "Do you currently live outside of the continental United States?"

ClientAddress – A Text variable for collecting the end-user's address.

The template author only wants ClientAddress to be available to the end-user if they select Yes in response to the question asked by the OutsideUS True/False variable. They add the following script to the script tab of the dialog editor:

GRAY ClientAddress

IF OutsideUS

UNGRAY ClientAddress

END IF

Now when the dialog first opens, ClientAddress is grayed and unaccessible. When the end-user selects Yes, the condition of the IF instruction is met and ClientAddress ungrays and becomes active. If the end-user selects No, ClientAddress stays gray and they can move on to the next dialog in the interview. The END IF instruction here closes the conditional region of the script.

Download

After you download the example template, you can import the template to any workspace to see this example code in action.