cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AndyTuke
Level: Powered On

Count number of lines in a multi line source

Has anyone managed to do this.  If I have a SharePoint list as a datasource with a multi line text column, I cant see a way to count the number of lines?


Accepted Solutions
Meneghino
Level 10

Re: Count number of lines in a multi line source

Basically a multi-line text field is simply a string which contains zero or more instances of Char(10) and/or Char(13).

 

You need to:

1) Determine which combination of Char(10) and/or Char(13) determines the new line in SharePoint

2) Use the Split() function to get the lines

3) Use CountRows() to count the lines

 

Hence for example something like this:

CountRows(
    Split(
        MyMultiLineField,
        Char(10)
        )
    )

All Replies
Meneghino
Level 10

Re: Count number of lines in a multi line source

Basically a multi-line text field is simply a string which contains zero or more instances of Char(10) and/or Char(13).

 

You need to:

1) Determine which combination of Char(10) and/or Char(13) determines the new line in SharePoint

2) Use the Split() function to get the lines

3) Use CountRows() to count the lines

 

Hence for example something like this:

CountRows(
    Split(
        MyMultiLineField,
        Char(10)
        )
    )
Lisea123
Level: Powered On

Re: Count number of lines in a multi line source

This works great when there is info in the text box. How would I make the total be 0 if there text box is blank?