Hello
I am trying to read an email and populate a SP list. My flow looks like this but the output from the filter array action seems to be correct as the body of the email is listed as an array with \n for each new line.
the expression for the last action is split(body('Filter_array')[15], '\n')[1] and there are well over 20 lines in the output text from the last action. Please help me make sene of the error message.
thanks
@vDemarais You can't use the split() action on an array. If you want to return the 11th line from the array, you need to use the array index. The first item in an array is [0], second, is [1] etc.
In your case, you will need to compose an expression. Start with
?[index key]
Click on the dynamic content tab and press the up arrow key to go to the start of the expression. Insert the body dynamic content from the Filter Array action.
Run a test. Tip: Remember to rename your actions to keep your flow organized!
To learn more about the Filter Array action, check out 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
thanks for your help.
Compose action: SplitIntoLines -
takes the output from SplitIntoLines action and keeps only lines with values
the next Compose action is supposed to look say line 11 and return the values after \n. A sample of the output text from the filter array is
\n
\nENVIRONMENT\n\nUPDATE WINDOW START
\n
\nUPDATE WINDOW END
\n
\nUAT UK
\n
\nThursday, April 18, 2024
\n2:00 PM (14:00) GMT
\n
\nFriday, April 19, 2024\n4:00 AM (4:00) GMT
@vDemarais The split() function requires a string (not an array) as the first parameter.
The Filter Array action outputs an array. Can you provide more insights to your flow logic?