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

4 REPLIES 4
tom_riha
Super User
Super User

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! 😄

what's the format for rows?

The element she used is called "Filter Array" / "Matriz do Filtro" (in PT-BR).

It works quite well. Thanks!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,326)