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 Platform Community / Forums / Power Apps / Filter Array to find S...
Power Apps
Answered

Filter Array to find Single Data Attribute from Array Variable

(0) ShareShare
ReportReport
Posted on by 439 Season of Giving Solutions 2025

Hi everyone,

 

This is probably quite an easy one to resolve but I'm wasting quite a lot of time trying to understand where the issue is and would really appreciate some help.

 

I have set up an Array variable, 'varArray'. Inside this is a set of records, each with two attributes, Attribute1 and Attribute2.

 

I have a second String variable, 'varString1'. Inside this is a string which will match the Attribute 2 value of one record in varArray.

 

I have set up an Apply to Each using the value of varArray.

Inside the Apply to Each I have set a Filter Array action to try to 'filter' varArray, when 'Attribute2' contains 'varString1'. 

 

I want to then set another variable which contains the output of the filter query.

 

I have had a series of errors, or, the filter query will return a null output even though there is definitely a match between Attribute2 and varString1, and tried to correct various aspects of the filter query but I'm not sure where the problem lies so any assistance would be much appreciated. Many thanks!

Categories:
I have the same question (0)
  • Verified answer
    BhaskarDhone Profile Picture
    1,398 Super User 2026 Season 1 on at

    If I understand correctly, you don't need Apply to each. Try something like below

    ClearCollect(
     varArray,
     { Attribute1: "Value1", Attribute2: "MatchValue1" },
     { Attribute1: "Value2", Attribute2: "MatchValue2" },
     { Attribute1: "Value3", Attribute2: "MatchValue3" }
    );
    
    Set(varString1, "MatchValue2");
    
    ClearCollect(
     varFilteredArray,
     Filter(varArray, Attribute2 = varString1)
    );
  • pp365 Profile Picture
    439 Season of Giving Solutions 2025 on at

    Hi @BhaskarDhone , my apologies, through force of habit I've written this in the Power Apps community whereas it should have been in Power Automate!

     

    I'll mark your suggestion as the Solution in case anyone is looking for this in the context of Power Apps.

     

    Thanks again!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard