cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
carudev
Helper II
Helper II

How to filter empty rows from an array?

Hi guys! 😄

 

I have these lines that I drew from a .csv and they always come with these " " empty at the end, and this is breaking my flow. Does anyone know how to filter or remove them?

carudev_0-1616595302863.png

Thank u!

1 ACCEPTED SOLUTION

Accepted Solutions
carudev
Helper II
Helper II

HI guys!
I found a very simple solution. I managed to solve it like this: using empty (item ()) is equal to false

@equals(empty(item()), false)

carudev_1-1617819093343.png

 

Just look at the exits, It worked really well:

carudev_0-1617818973010.png

I hope this may help you guys, thanks! 😄

View solution in original post

2 REPLIES 2
tom_riha
Super User II
Super User II

Hello @carudev ,

if it's always exactly 1 empty item in the array at the end, I'd use the take(...) expression to take from the array only lenght-1 number of items.

like this, but I'm not sure about the dynamic content format, you might need to replace it:
take(outputs('Matriz_do_filtro'),sub(length(outputs('Matriz_do_filtro')),1))

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
carudev
Helper II
Helper II

HI guys!
I found a very simple solution. I managed to solve it like this: using empty (item ()) is equal to false

@equals(empty(item()), false)

carudev_1-1617819093343.png

 

Just look at the exits, It worked really well:

carudev_0-1617818973010.png

I hope this may help you guys, thanks! 😄

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (55,541)