web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : /bYrXGlZ22ZTcaB36SPd02
Power Automate - Building Flows
Answered

How do I remove an empty row in HTML text - HTML file to JSON

Like (0) ShareShare
ReportReport
Posted on 17 Nov 2023 07:49:56 by 6

Hi all & thanks for the support! 

 

I'm in the process of creating a flow which takes a HTML email attachment and converts it to JSON. It captures the attachment via email > converts the contentBytes to a string > Replaces the column delimiter with '^' and row delimiter with '|' > Converts it to text > splits the text by each row > filters out rows containing 0 characters > splits and maps data to it's respect column. 

 

FlowOverview.png

After using the select data operation in the last step and mapping column names to data from the filtered HTML text output, I get this error:

 

FlowError.png

After combing through the HTML text output, I found that there is a row with no data however only has a column delimiter which I believe is causing this error.

 

FlowRowtoRemove.png

Is this the correct assumption and how can I remove this to not have this error? 

I have the same question (0)
  • Chriddle Profile Picture
    8,087 Super User 2025 Season 2 on 17 Nov 2023 at 08:29:09
    Re: How do I remove an empty row in HTML text - HTML file to JSON

    split(item(), '^')[a_number] fails whenever a row does not contain sufficient amount of '^' (a_number-1).

    You can check this with the length(split(item(), '^')) before accessing it.

    But parsing HTML is harder than you might imagine, and often impossible when only using PA expressions ‌.
    Can you show an example of the HTML table source?

     

  • SuperUser- Profile Picture
    6 on 17 Nov 2023 at 08:27:13
    Re: How do I remove an empty row in HTML text - HTML file to JSON

    Thanks @v-bofeng-msft I had it set to 0 - didn't even think to change it. Setting a higher value works well, cheers. 

  • Verified answer
    v-bofeng-msft Profile Picture
    on 17 Nov 2023 at 08:22:37
    Re: How do I remove an empty row in HTML text - HTML file to JSON

    Hi @SuperUser- ,

     

    You can determine the length of the string and skip it if it is less than a certain range, for example:

    vbofengmsft_0-1700209303092.png

    length(item())
     

    vbofengmsft_1-1700209337560.png

     

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 798 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 469 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 333

Last 30 days Overall leaderboard