I have a flow which is extract each line from a text document into either a excel or SharePoint list.
Problem is, some of the text files that I will receive from external users may have a blank line after the last scan which is causing my flow to fail once it gets to the last row because it can't read the barcode after the 3rd comma because it doesn't exist.
Is there a way to wipe out that line with just the "" before i start looping each to feed the excel or list to prevent a failed flow run?
@creativeopinion That worked like a charm but now when I try and write values to excel or SharePoint I get the following error message when testing the flow. I assume I need to do some sort of conversion?
@IllFigureItOut The screenshot you've shared isn't a string, it's an array. You can filter out the empty items by using a Filter Array action.
Insert the output from your Compose action into the from field. In the first value field, insert an expression and use the item() function.
Change the operator to is not equal to and leave the second value field blank.
Run a test.
To learn more about how to use the Filter Array action, please refer to this YT Tutorial: Are you using the Microsoft Power Automate Filter Array Action wrong?
In this video tutorial I’ll show you 3 practical ways to use the Filter Array action and how to use it properly.
1️⃣ Cross-Referencing Data
2️⃣ Filtering by Key
3️⃣ Substring Matching
Did you know that the Condition action has a limit of 10 conditions? Although it might look like the Filter Array action can only accept one condition—this is not true. By using the advanced mode you can enter multiple conditions into a Filter Array action with an expression.
IN THIS VIDEO:
✅ 3 Ways to Use the Filter Array Action
✅ How to use the Scope Action to Group Actions
✅ How to Check the Number of Items returned from a Filter Array Action
✅ How to Cross-Reference Data in Excel with a SharePoint List
✅ How the Filter Array Action Works
✅ How to Access the Dynamic Content from a Filter Array Action
✅ How to Filter Items by a Key
✅ How to Filter Items by Matching a Substring
✅ How to Use Multiple Conditions in a Filter Array Action
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1