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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse JSON - skip last...
Power Automate
Unanswered

Parse JSON - skip last row?

(0) ShareShare
ReportReport
Posted on by 50

I am facing an issue where a system generated CSV file I am receiving comes with a linebreak after the last row, essentially identifying as having 41 rows when in reality it only has 40.

 

When I am parson my JSON I am splitting each record based on a "linebreak" which now breaks the flow since the last entry is "null" for every column, and in terms of schema I dont want / cannot allow null values for required fields. 

 

In short, either when selecting my data or splitting my data, I would need a way to dynamically split the last row before proceeding with the parsing of the JSON. How do I achieve this?

 

Flow sequence:

- get CSV file content

- convert CSV from Base64 to string and split each record after "linebreak"

- split off the first record which are the column headers

- skip headers and select all remaining rows, mapping the various fieldnames and items

- Parse JSON based on schema where all values are "strings"

- Error: last row is NULL which doesnt match the schema

 

 

 

LiXiaoPai_0-1703576348959.png

 

LiXiaoPai_1-1703576371208.png

 

Categories:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @LiXiaoPai 

     

    You could use "Filter array" action to filter the null values from the output of select action.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • LiXiaoPai Profile Picture
    50 on at

    That worked wonders, thank you!

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @LiXiaoPai 

     

    I am glad that it solves your problem 🙂

     

    Few days back, I posted the blog for converting csv to JSON objects but in that part you are excellent:

    How to convert CSV file to array of JSON objects? - Power Platform Community (microsoft.com)

     

    Thanks

  • LiXiaoPai Profile Picture
    50 on at

    @ManishSolanki where have you been when I needed you one week ago?! 😄

     

    Excellent guide, love the simplicity, well done sir. Thank you very much!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard