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 / Need help - Filter Arr...
Power Automate
Unanswered

Need help - Filter Array to return SharePoint List items to pass back to Power App

(0) ShareShare
ReportReport
Posted on by 282

Due to the delegation issues with search in SharePoint, I’m attempting to use Power Automate to...

  • Take a text input from my Power App and store the string in the trigger input as searchTerm
  • Get SharePoint list items HelpdeskTickets, filter them for only those where searchTerm is contained in ‘Title’ or ‘Description’ columns
  • Return the results to my Power App in an output called searchResults

First, I used the “Filter Query” property on the “Get Items” action. I got the solution to return a full list of items, but limited to ONLY searching the Title column (turns out “substringof” does not work in SharePoint Note (multi-line text) columns)

 

Here is the flow structure that worked in a limited fashion...

rkirk2k_2-1686938923870.png

rkirk2k_4-1686939070088.png

So I KNOW the solution is viable...

 

Now, instead of using the Filter Query on the Get items action, I thought of using a Filter Array action to take the output of Get items, isolating the desired items/records (using an OR conditional statement), and appending each to an array variable.

 

My plan...

  • After the trigger that stores searchTerm, createa an array variable called varSearch using Initialize variable (type array)  
  • Take the output of Get items, into an Apply to each control where I want...
    1. Use Select to grab only the columns I'm interested in
    2. Use Filter array to only grab items/records that meet my criteria
    3. Append to array variable to add each item found to varSearch, building an array that includes all the items returned
  • Take the array stored in varSearch into a Compose control, and...
  • Pass that into my Respond to PowerApp or flow control to be handed back to my Power App

Here is my current configuration...

rkirk2k_6-1686940222706.png

 

rkirk2k_7-1686940303206.png

rkirk2k_8-1686940346243.png

 

I'm having the following error in my Select control that I don't know how to resolve...

 

The 'from' property value in the 'select' action inputs is of type 'Object'. The value must be an array.

 

 

Any assistance or thoughts on how to get this working is greatly appreciated.

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @rkirk2k 

     

    Pls modify the flow as per below instructions:

    1. After 'Get items' action, add filter action that will filtered out the records based on the input search term in Title and Description field (multiline text field). Add "Filter array" action, pass the get items result as input and click on 'Edit in advanced mode':

    ManishSolanki_0-1687007358535.png

    The filter expression used in above screenshot is:

    @or(equals(contains(item()?['Title'], triggerBody()['text']), true),equals(contains(item()?['Description'], triggerBody()['text']), true))

    here, triggerBody()['text'] is the input search term parameter received from canvas app.

     

    2. Next, we use 'Select' action to get only the required fields from Filter array result:

    ManishSolanki_1-1687007568016.png

     

    3. Now, pass the output of select action to compose action:

    ManishSolanki_2-1687007629240.png

     

    4. Finally, pass the output of 'Compose' action to the power apps:

    ManishSolanki_3-1687007685096.png

     

    If this helps & solve your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • rkirk2k Profile Picture
    282 on at

    Thank you @ManishSolanki for responding to this.

     

    You've helped me get closer - as I actually have results coming back successfully. However, the "Filter array" condition statement seems like it is only evaluating the "Title" field.

     

    I'm not getting results where the search term (from the trigger) is in the "Description" field. The ability to evaluate both fields is critical to my requirement.

     

    Any ideas?

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @rkirk2k 

     

    Use the following query in 'Filter array' action which we fetch the records from Title & Description fields:

    @or(equals(contains(item()?['Title'], triggerBody()['text']), true),equals(contains(item()?['Description'], triggerBody()['text']), true))

    ManishSolanki_0-1687185464590.png

     

    You will get filter query textbox on clicking on 'Edit in advanced mode'

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • rkirk2k Profile Picture
    282 on at

    That is the same query you provided, that isn't working. Any ideas why?

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    @rkirk2k 

     

    Have you checked if the array you are filtering has the field "Description"?

     

    Can you share sample data of "Get items" (or your select statement) and sample data you use to filter and I will have a look at it.

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard