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!
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!
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)
);
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional