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 / Create Collection with...
Power Apps
Unanswered

Create Collection with Nested Forall

(0) ShareShare
ReportReport
Posted on by 20

Hi, 

I’m new in Powerapps and I need some help to develop a formula to merge two tables in one following the next example:

Table1:                       

ID

Name:

1

A

2

B

3

C

 

Table2:

ID

Task:

1

X

2

Y

3

Z


EndResult:

ID

Name:

Task:

1

A

X

2

A

Y

3

B

X

4

B

Y

5

C

Z

 

A and B have X and Y task and C have only Z task.

Thanks for your help!

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PeterGM3 

    You are describing a many to many relationship between people and tasks. This usually requires a junction table consisting of two columns, peopleID and taskID.  This table can be viewed by selecting the person from the people column and viewing the junction table filtered on peopleID showing the tasks for each person.  Alternatively the same table can be viewed by selecting the task and then filtering the junction table on taskID to show who is responsible for the task. 

  • PeterGM3 Profile Picture
    20 on at

    Hi @Drrickryp , thanks for your reply.
    What I need is to generate that table in a collection.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PeterGM3 

    Dataverse, SharePoint or some other connector?

  • PeterGM3 Profile Picture
    20 on at

    @Drrickryp 

    I need to create the collection in Powerapps:
    ClearCollection(colName,{ID:1,Name:A},{ID:2,Name:B},{ID:3,Name:C};
    ClearCollection(colTask,{ID:1,Task:X},{ID:2,Task:Y},{ID:3,Task:Z};
    ClearCollection(colResult,____________________};//Here I need to have the N:N table

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PeterGM3 

    If you have a dropdown like ddName with colName and one like ddTask with colTask as the items property, you will need to collect them dynamically using a button that has as its OnSelect property Collect(nametask, {NameID: ddName.Selected.ID , TaskID:ddTask.Selected.ID})

  • PeterGM3 Profile Picture
    20 on at

    @Drrickryp 

    I need to generate this list because every time I click a button, I need to patch this table into a list with the name of a product.
    Also I bringing the Name table and the Task Table from a list in Sharepoint, so it could change through time.

    Product List

    ID

    Name:

    Task:

    Product:

    1

    A

    X

    1

    2

    A

    Y

    1

    3

    B

    X

    1

    4

    B

    Y

    1

    5

    C

    Z

    1

    6

    A

    X

    2

    7

    A

    Y

    2

    8

    B

    X

    2

    9

    B

    Y

    2

    10

    C

    Z

    2


  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PeterGM3 

    I would need to see the user interface to better understand your issue.  I feel like I'm shadowboxing.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PeterGM3 

    I would need to see the user interface to better understand your issue.  I feel like I'm shadowboxing.

  • PeterGM3 Profile Picture
    20 on at

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard