cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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?

1 ACCEPTED SOLUTION

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)
        )
    )
3 REPLIES 3
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?

Highlighted
Boneckrh19
Level 8

Re: Count number of lines in a multi line source

@Lisea123 

If( 
    IsBlank(MultilineField), 

    //if your field is blank, return 0
    0, 

    //if your field is not blank, return the number the code returns
    [your currently working code] 
)

 

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 4 members 2,819 guests
Recent signins:
Please welcome our newest community members: