cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aanyoti
Helper I
Helper I

Help with Split output - CSV Lines

Hi,

I need some help with filtering output of my Compose action.

 

 

 

 

split(outputs('CSV_File_to_String'),decodeUriComponent('%0A'))

 

 

 

 

The output splits a line with the below that produces an error in the next Build JSON action

 

 

 

""

 

 

 

 

aanyoti_0-1631012281255.png

 

 

aanyoti_2-1631012364691.png

 

I would like the Apply to each function to only output the first line of the CSV and ignore the rest, how can I achieve this?

 

Below is the flow for your information

 

aanyoti_3-1631012778831.png

 

 

 CSV Lines

split(outputs('CSV_File_to_String'),decodeUriComponent('%0A'))

 

Apply to Each

skip(outputs('CSV_Lines'),1)

 

Split By Comma

 

split(item(), '",')

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Add a filter array action and remove any lines that are zero length, like this:

2021-09-07_16-28-19.png

View solution in original post

5 REPLIES 5
abm
Super User
Super User

Hi @aanyoti 

 

Could you expand the Build JSON step and post a screenshot?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi @abm ,

 

See below screen shot. Also see code used

 

replace(outputs('Split_By_Comma')?[0], '"', '')

 

aanyoti_0-1631023637951.png

 

Paulie78
Super User
Super User

Add a filter array action and remove any lines that are zero length, like this:

2021-09-07_16-28-19.png

Thanks alot @Paulie78 , that has worked!

 

Can you please advise how I can apply a filter to output the first CSV line only?

Sure, this should do it:

first(outputs('CSV_Lines'))

 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,736)