Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to render empty variables inside RITM's variable editor?

Pooja Yuvaraj
Tera Contributor

I have a scenario where the variable editor needs to have variables irrespective of values present in it. Currently I can see RITM renders only non-empty variables after request submission. I have tried both UI policy and Client script with Applies on Requested Item, to validate this but only can view the non-empty variables.

I want to display both empty and non-empty variables in the variable editor of RITM form so that the ITIL user will fill the empty variables on behalf of external users in RITM.

Note: Non-empty variables are rendered correctly in the RITM form. Now I just want empty variables inside RITM form.

PoojaYuvaraj_0-1792148220617.png

 


Can anybody suggest me the possible solution?

1 REPLY 1

Rafael Batistot
Mega Patron

Hi @Pooja Yuvaraj 

 

By default, ServiceNow’s Variable Editor only shows variables that have a saved value in the ⁠sc_item_option⁠ table upon request submission. Empty fields are omitted entirely.

 

To make empty variables visible on the RITM:

 

1. Set Default Values: Give the variables a default value (like a single space ⁠' '⁠ or ⁠'N/A'⁠) in the variable definition so ServiceNow creates the record on submission.

 

2. Use an ⁠onSubmit⁠ Script: Add an ⁠onSubmit⁠ Catalog Client Script on the Catalog Item view to set empty fields to a single space ⁠' '⁠ right as the user submits the form.

 

 

If this response was helpful, please mark it as Helpful and, if applicable, as Correct.
This helps other users find accurate and useful information more easily