Announcements
ClearCollect(
CollectionCode,
ForAll(
Distinct(
Filter(
CollectionA),Group),
Lookup(ListA,
columnA = Value
).columnB));
The above formula fetchs only one record that matches the criteia. But need to pull all the records that matches the value.
THanks.
Hi @HarishaAkkil
try this:
ClearCollect( CollectionCode, ForAll( Distinct(Filter(CollectionA),Group), Filter(ListA, columnA = Value).columnB // Changed to Filter ) );
If you have any questions or feedback, please let me know. Have a great day! 😊-----------------------PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
From what I can tell of the code, you are trying to create a collection of values columnB. Doing this by filtering CollectionA and getting all unique values of the column 'Group' then doing a lookup on ListA, where columnA equals the unique value 'Group'.
How many distinct values of Group are there?
ClearCollect( CollectionCode, ForAll( Distinct( Filter( CollectionA, 1=1 ), Group ), Lookup( ListA, columnA = Value ).columnB ) );
Hi @SpongYe ,
Getting error saying incompatiable type. The collection can't contain this value.
Please help.
Thanks.
Change the order of the Forall en Collect so you can loop through the items and collect the record into the collection.
ForAll( Distinct(CollectionA, Group), Collect( CollectionCode, LookUp(ListA, columnA = ThisRecord.Value).columnB ) )
No doesn't work as expected, resulting the same output.
@HarishaAkkil
it looks like the collection is outside of the forall, I've moved the collection around and removed the distinct. The distinct can be added back in if required.
Clear(CollectionCode); ForAll( Filter( collectionA, 1=1 ) As dataLoad, Collect( CollectionCode, LookUp( ListA, dataLoad.<columnname> = columnA ).columnB ) );
-------------------------------------------------------------------If I have answered your question, please mark your post as Solved.If you like my response, please give it a Thumbs Up.
Using Lookup fetches only one data that matches in the List A, But List A has many records that has same name as DataLoad. Is there any other way to rewrite it by avoid using LookUp?
Hi @realwillwright ,
Instead of Lookup I used Filter. It did worked. Thank you so much. You are really great.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 382 Super User 2026 Season 2
Mohsin Ali 329
WarrenBelz 187 Most Valuable Professional