Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

ForAll Collect duplicates

Hey guys,


I'm having a hard time with a ForAll and Collect formula.


The selections that I have are:

combobox1 = text1, text2

combobox2 = value1


Value email1 is linked to text1 and email2 is linked to text2.


Based on selections and dependencies in combo boxes, the final result should be like this:



Instead it generates this:



In this case the email1 should not get text2 and email2 should not get text1 information in column1. 

If I add value2 besides value1 to column 3, it will generate another set of 4 rows, but with the value2 on column3.


The formula looks like this: 


ForAll(combobox1.SelectedItems As a1,ForAll(combobox2.SelectedItems As a2,ForAll(combobox3.SelectedItems As a3,Collect(collection,{column1:a1.Title,column2:a2.Email,column3:a3.Title}))))



If you have any thoughts, it would be much appreciated. Thank you!

Super User
Super User


The biggest issue is that your formula has the ForAll backward. You are trying to use it like a ForLoop in some development language - which PowerApps is not.  ForAll is a function that returns a table of records based on your iteration table and record schema.

It is more efficient to use the function as intended and will provide better performance.

And in your case, you need to realize that each ForAll is creating a table.  AND, each ForAll takes a parameter (the second) to specify the record schema of the table returned from the, since you are not specifying it, it is creating (based on the flow of your formula) a Table with a column that has a table that has a column that has a, you are getting a lot of table-in-table results and your results will be as you are seeing.


Can you describe a little more on the Items properties of Combobox 1, 2 and 3?  What you are trying to achieve is usually handled better within the Items property.  Also, if you have a DefaultSelectedItems property set on any of them, what are those.

I ask more because you mentioned combobox 1 and 2 in your post, but your formula references combobox3 and the relationship did not seem apparent.


Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!


Yes, I am very aware of that. But I couldn't find another solution at the time.


The Items Properties of Combo Boxes are Share Point lists because I'm trying to avoid to hardcode them in the app. 


Basically I'm trying to create an access request app where the user can select the various combinations of options and then those selections are recorded to a Share Point list from where they are processed by an Approval flow.


So let's say I want to request a regional access for a dashboard. I select the dashboard that I want access to (let's say dash1), I select Regional access, then on the next combo box I am presented with RegionA, RegionB, RegionC (each of them has different approvers). I pick RegionA and RegionC. Now, I want this information to be patched to a Sharepoint List like this:




Thank you!


I think you would understand better what I'm trying to do from the post were it was recommended to me to use ForAll.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,221)