Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Stuck with a flow to read email content

(0) ShareShare
ReportReport
Posted on by 2

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.

 

vDemarais_0-1715034320736.png

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

 

  • creativeopinion Profile Picture
    creativeopinion 10,064 on at
    Re: Stuck with a flow to read email content

    @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]

    creativeopinion_0-1715036149249.png

    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.

    creativeopinion_1-1715036204192.png

    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

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

     

  • CU15011035-0 Profile Picture
    CU15011035-0 2 on at
    Re: Stuck with a flow to read email content

    thanks for your help.

     

    Compose action: SplitIntoLines - 

    split(body('Html_to_text'), outputs('NewLine'))
     
    Filter array:
    vDemarais_0-1715035662727.png

    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

     
  • creativeopinion Profile Picture
    creativeopinion 10,064 on at
    Re: Stuck with a flow to read email content

    @vDemarais The split() function requires a string (not an array) as the first parameter.

    creativeopinion_0-1715034966320.png

    The Filter Array action outputs an array. Can you provide more insights to your flow logic?

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard