1

I have a list that I'd like to do some validation on, but I'm having trouble with the exact syntax of the idea (if it's even possible). The idea is that if a list item's field is NULL, then the particular field will populate with "N/A" when the item is saved in the list.

Any ideas?

2 Answers 2

2

Columns are"blank" rather than NULL. Try this in a Calculated Column if you want to display the message in another column.

. =IF( ISBLANK( [yourColumn] ), "n/a", "")

If the column is a Single line of Text column, then you could set the default to "n/a".

You can add a validation if you want to prevent the save when blank.

1
  • I'd rather display the "N/A" message in the same column, but let's see how this goes. Of course, using the N/A as default on CHOICE columns works, too (although it took me a minute to consider that option. It's Friday, and my brain is certainly acting like it). I'll keep you posted. Thanks!
    – DanJ
    Jul 6, 2018 at 21:19
1

Same column default calculated values wont work as the formula can not circular reference the column which contains it.

However, this can be achieved a number of ways, depending if you simply wish to display the N/A for cosmetic purposes in the UI, or if you actually require the underlying value to be set.

For display only :-

Or if you actually need to set the underlying value :-

  • Column default value set to N/A - This trade off will actually set the value of the column the first time a user leaves it blank, but if a user changes to something else and then sets it to a blank value again it will no longer be N/A
  • Workflow / Event Receiver or other external programmatic process (Timer job) to set the value to N/A whenever it is detected as being blank
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.