6

I have a multi-line text field and need to be able to show a view with only items where that field is blank (or functionally blank to a human looking at it).

I've tried:

  • field contains ""
  • field contains "" or field contains " "
  • field contains <div></div>
  • field contains "<div></div>"

But none of them work.

Surely this can be done.

  • What is the format of the multi-line text box, is it palin text, rich text or enhanced rich text? – Eric Alexander May 24 '11 at 15:05
  • @PirateEric it was a text field but changed it to RT to test the below answer. However, it didn't work even after creating a new record. – Keng May 24 '11 at 17:00
5

If you want to stay in the UI, you could try a method similar to @theChrisKent but use 5 filters instead and for each filter do a contains for a, e, i, o, u. This would obviously assume that any input in the fields would contain a word (including a vowel). See screen shot below.

A second approach would be to create a view in the library and then use SharePoint designer to modify the view to look for a null value. See this post for more info.

enter image description here

  • I don't understand how this is supposed to work. This wouldn't show items whose multiline field is blank, it would show items whose multiline has at least one vowel. – theChrisKent May 24 '11 at 21:09
  • Though this doesn't get me my 'blank' filter criteria, it is good for a laugh at MS. I am able to filter my view using this on another field to get what I need though. – Keng May 25 '11 at 16:17
  • This does not work! – Hari Gillala Mar 27 '12 at 14:43
  • Works fine for me. Nice solution! – dwwilson66 Aug 1 '12 at 13:21
  • This is actually what I was looking for - filter on the field being not blank - I saw the question and thought maybe I could extrapolate from the answer to the question that was asked. As it happens, no extrapolation was necessary! +1. – Dan Henderson Sep 19 '16 at 19:24
4

You will need three Filters all with ORs between them:

  • [Field] contains
  • [Field] contains <div></div>
  • [Field] contains <div>&nbsp;</div>

Here is a screenshot to make this a little more obvious: enter image description here

In the image above Answer is a Multiple lines of text field allowing Rich text

UPDATE:

For Multiline plain text fields just doing [Field] contains '' won't work. Instead, setup the view with all the columns you want, sorting, grouping, etc. Then edit the view in SharePoint Designer. In the View XML find the section and edit to get the results you want.

To show only those items where your field (Single or Multi-line text) is blank:

<Where>
    <IsNull>
        <FieldRef Name="SomeText"/>
    </IsNull>
</Where>

To show only those items where your field is NOT blank:

<Where>
    <IsNotNull>
        <FieldRef Name="SomeText"/>
    </IsNotNull>
</Where>
  • Well rats! It seems this only works if the Answer field has info put into it and then removed. It doesn't pull up all the items that were in the List prior to creating the view. When I make a new item and then run the list it doesn't show up either. I made the field Rich Text just like your test here before I did the tests. The new record that isn't showing up was created as a RT field rather than being converted. – Keng May 24 '11 at 16:59
  • @Keng this is strange. If the column starts as a Rich Text type, then my solution works just fine. Switching the type from Plain to Rich Text doesn't pick up any old values (although new items seem to work fine). Is this a list that already has a lot of blank items? – theChrisKent May 24 '11 at 21:08
  • yeah, it had a lot of blank items. that didn't show up so i thought that it was because of the switch but then when I made the new record it still didn't show up. If it's working for you, then it's gotta be a column type switching bug that is keeping the new records from showing up. Too bad really, an 'IsNull' would save everyone a lot of grief. – Keng May 25 '11 at 12:32
  • It does not work! – Hari Gillala Mar 27 '12 at 14:57
  • @HariGillala perhaps you could share a little more info about your problem, steps you've taken, etc. Just saying it doesn't work, doesn't help a whole lot. – theChrisKent Mar 27 '12 at 15:13
1

Try this- Worked for me. Convert your multiple lines of text field to a Single line of text. Create the view using the "is not equal to" and then leave the criteria blank. Once the view is created change the field back to multiple lines of text.

Example

  • One problem with this solution is that if any items in the list already contain more than one line of text, or any rich text if your multiline field is of that type, converting the field to Single Line of Text will immediately and irreversibly discard the additional lines and/or text formatting from those items. – Dan Henderson Sep 19 '16 at 18:39
0

The easier solution is to create a formula field - if(<expectedfield>="",0,1). Now you may place the filter based on 0 and 1. Problem solved.

0

For Example, In AllItems.aspx view, you can filter for empty fields in text colums, multi line text colums and multi line rich text colums using the following syntax: "http://.../AllItems.aspx#InplviewHash...=FilterField1%3DColumname-FilterValue1%3D".

Filter value %3D means equal. If you add nothing you will get the empty fields. Instead of the ... (dots) fill in your correct paths and names.

If you need the non empty fields you can do it by editing the view parameters in the view settings (see the masks settings in the other answers).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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