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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filtering a multi-valu...
Power Automate
Answered

Filtering a multi-value choice field?

(0) ShareShare
ReportReport
Posted on by 7
Hello,

I have an O365 list, the Disposition list, with a Series Number, an integer field of days each content type is kept, and a column for Document Content Type.

When an item is created at any library, the flow is intended to take a document's default content type at creation and compare it to the document content type field of the Disposition list. If the content type is found, the entire row from the Disposition list should be returned. If a document content type changes at the library, the same process should run.
 
I know two Apply to each actions will be used. That's no problem. The issue is that the multi-value choice field of the Dispositon list does not allow a CONTAINS operator with the Get Items filter option.

How can the content type text value of a document in a library be matched to a row in the Disposition list and only that row be returned?

At the first Apply to each, I've added some Compose and Selects to extract the content types:
Categories:
I have the same question (0)
  • Suggested answer
    Expiscornovus Profile Picture
    33,194 Most Valuable Professional on at
    Hi @RLNtel,
     
    You can use a substringof in a Filter Query for this.
     
    Below is an example, if that helps?
     
     
    1. List setup with a Letter column (multi-choice)
     
     
    2. Flow setup with the below filter query which looks for the Alpha value
    substringof('Alpha', Letter)



    3. Test result which only returns list items with title Test & Test2



     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
     
     
  • Verified answer
    Riyaz_riz11 Profile Picture
    3,860 Super User 2025 Season 2 on at
    Hi,
     

    Solution 1: Filter After Retrieval (Recommended)

    Since you can't filter multi-value choice fields in the Get Items action, retrieve all items and filter in the flow: 

    1. Get Items (Disposition list) - No filter, get all items
    2. Apply to each (Disposition list items)
       - Condition: Check if document content type exists in the multi-value field
       - Expression: contains(join(items('Apply_to_each')?['DocumentContentType'], ';'), variables('DocumentContentType'))
     

    Detailed steps:

    Apply to each: outputs('Get_items')?['value']
      └─ Condition
         └─ Left side: contains(join(items('Apply_to_each')?['DocumentContentType'], ';'), variables('DocumentContentType'))
         └─ Right side: true
         └─ If Yes: Return this row (use Compose or variable)
     

    Solution 2: Use Filter Array Action 

    More efficient approach using Filter Array:

    1. Get Items (Disposition list) - No filter
    2. Filter array
       - From: outputs('Get_items')?['value']
       - Condition: contains(join(item()?['DocumentContentType'], ';'), variables('DocumentContentType'))
    3. Apply to each (filtered results)
     

    Filter Array Expression:

    contains(join(item()?['DocumentContentType'], ';'), variables('DocumentContentType'))

    Solution 3: Advanced Expression Method

    Use this expression in a Filter Array for exact matching:

    contains(
      string(item()?['DocumentContentType']), 
      concat('"', variables('DocumentContentType'), '"')
    )

    This handles the JSON array format of multi-value choice fields.

    Solution 4: Complete Flow Structure

    Here's the complete flow structure 

    1. When an item is created/modified (Library trigger)
    2. Get item (to get the document details)
    3. Initialize variable: DocumentContentType = triggerOutputs()?['body/ContentType']
    4. Get items (Disposition list) - no filter
    5. Filter array
       - From: outputs('Get_items')?['value']
       - Condition: contains(join(item()?['DocumentContentType'], ';'), variables('DocumentContentType'))
    6. Condition: Check if filter array has results
       - If Yes: Apply to each (filtered results)
         └─ Process the matching disposition row
       - If No: Handle no match scenario
     
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • RLNtel Profile Picture
    7 on at
    @,

    I was able to get your Solution 1 to work; however, the Document Content Type multi-value choice field in the Disposition List has values like 'Agreement' and 'Support Agreement'. If the content type, Agreement, is chosen, both the row containing 'Agreement' and the row containing 'Support Agreement' are returned.

    Any suggestions?
  • RLNtel Profile Picture
    7 on at
    @,

    I was able to get your substringof solution working; however, the argument only allows for a text value. When I attempted to replace the text value with a dynamic value, it failed. 

    Any thoughts?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard