Blank out a number field that defaults to zero.


Badge +2

I have a SharePoint 2013 on prem list that has a number field. Most of the time when a form is filled out this field is left blank (as it needs to show). We report off of this field and need for it to show blank and not "0". 

Is there a way for me to do this with either forms or workflows?

Thanks


3 replies

Badge +9

Hi Ryan McDeavitt,

In column settings you can clear out the default value.

206437_pastedImage_1.png

Or, If you want you can do using JavaScript also. Name number control's JavaScript variable as 'Number'.

206390_pastedImage_1.png

Add this code in form settings->Custom Javascript

NWF$(document).ready(function()
{  
   var number = NWF$('#'+Number).val();
   if(number == 0)
   {
     NWF$('#'+Number).val('');
   }
});

 Thanks,

Lakshmi C

Userlevel 5
Badge +14

how do you have configured default value in list field and form control?

if neither of the two is configured, field should left blank.

Badge +11

Hi @lakshminarayana 

Can I use that java script in a 365 task form? It doesn't error when i publish the workflow, however the task form refuses to open. It sits there trying to open. 

NWF$(document).ready(function()

   var number = NWF$('#'+Number).val();
   if(number == 0)
   {
     NWF$('#'+Number).val('');
   }
});

Reply