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?

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?

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

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 40 members 4,084 guests
Please welcome our newest community members: