web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Suggested Answer

Filter Array

(0) ShareShare
ReportReport
Posted on by 2
Need to use 2 filter conditions in Filter array and how to add that. Teams message creation within 3 hours and fetch the particular message(Feed Status). My requirement is as follows. if possible, please provide the entire flowchart.
 
Requirement:
1. Extract the teams message from one group within 3 hours and fetch the particular message which has only the 'Feed Status'.
2. Post in other teams group with the text format.
 
currently used this flow. its working but unable to use to 2 filter conditions. Also, output message not coming with proper text format. please help me with the entire flow.
 
 
I have the same question (0)
  • David_MA Profile Picture
    14,605 Super User 2026 Season 1 on at
    You can refer to this blog post for filtering arrays: Power Automate Filter Array [with 17 examples]. The first examples show single filter techniques and toward the bottom ts shows how to combine filters so you can have multiple conditions.
     
    This is one of the examples with multiple filters: @and(equals(item().Department, 'IT'),equals(item().Age, '50'))
     
  • Amardeep Raj Profile Picture
    56 on at

     

    Solution — Filter Array + Select + Apply to Each (Convert HTML to Text)

     

    Step 1 — Filter Array

     

    • Input (From):


    •  
    •  
    •  
    •   
    @{body('Get_messages')?['value']}
    
     

    • Filter condition:


    •  
    •  
    •  
     
    @{and(
      equals(item()?['messageType'], 'message'),
      contains(toLower(item()?['body']?['content']), 'feed status'),
      greaterOrEquals(item()?['createdDateTime'], addHours(utcNow(), -3))
    )}
    
     

    Step 2 — Select

     

    • From:

    •  
    @{body('Filter_array')}
    
     

    • Map:

    •  
     
    {
      "Message": "@{item()?['body']?['content']}"
    }
    
     

    Step 3 — Apply to Each

     

    • Input: output of Select action

    • Inside the loop, add Convert HTML to Text action

    • Input:
     
    @{items('Apply_to_each')?['Message']}
    
     

    Step 4 — Post Message to Teams

     

    Use the output of Convert HTML to Text as the message body to post to your target Teams group in plain text format.


    Please Watch This
    Send Filter message to teams.mp4
     

    If this helped, please mark as Solution so others facing the same issue can find it quickly.

    Thank you

  • Suggested answer
    Inogic Profile Picture
    1,291 Moderator on at
    Hi,
     
    You can achieve this by using Filter Array in Advanced Mode with an and() condition.

    Currently your flow is filtering only based on the message creation time. To add the second condition (Feed Status text), you need to combine both conditions together.
    Use the below expression in Filter Array → Edit in advanced mode:
    @and(
       greaterOrEquals(
          item()?['createdDateTime'],
          addHours(utcNow(),-3)
       ),
       contains(
          toLower(item()?['body']?['content']),
          'feed status'
       )
    )

    What this does:
    • Checks messages created within the last 3 hours
    • Checks whether the message contains the text “Feed Status”
    For the formatting issue:
    Teams messages are stored in HTML format, so when posting them to another channel the text may not look correct.
    To fix this, add an HTML to Text action inside the “Apply to each” before posting the message.

    Flow structure would look like this:
    Recurrence

    Get messages in a chat or channel

    Filter Array

    Apply to each

    HTML to Text

    Post message in another Teams channel

    In the “Post message” action, use the output from HTML to Text.
    This should solve both:
    • Multiple filter conditions
    • Proper readable message formatting
    Hope this helps.

    Thanks!
    Inogic

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard