cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lorenzobr
Helper I
Helper I

Using RELATE on multiple columns

Hi,

I have 2 Dataverse tables in a many-to-many relationship: COURSE (course.day1, course.day2, course.day3) and USERS.

I need to enroll USERS to COURSE that last 1, 2 or 3 days, so I need to relate them to each day (or each column if you prefer), because USERS on day1 could be different from USERS on day2 (but the USERS list is the same).

How can I relate/enroll USERS in this case?

 

Ps. Is there also anything to bulk enroll USERS to all days?

 

Thanks in advice

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @lorenzobr ,

 

Looking into your description, you have columns of each day within the Course table. So it looks more like one to many relationships of each day columns to the User table. All the days column should be LookUp columns looking to the User table and allow multiple values.

 

If you have all those LookUp columns in the Course table, you can use a Gallery to display all the courses and add combo boxes bound to different columns (e.g. day1 column: Items = Choices(Course.Day1)) and set them allow multiple selections, then you will be able to select users in all the combo boxes. At last use a button to update the Gallery to the Course table.

ForAll(CourseGallery.AllItems, 
       Patch(Course, 
             ThisItem, 
             {Day1:Combobox1.SelectedItems,Day2:Combobox2.SelectedItems,...}
       )
)

 

For the last question, since days are columns of the Course table and allow multiple values, there is no way to bulk relate each column with a specific user.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @lorenzobr ,

 

Looking into your description, you have columns of each day within the Course table. So it looks more like one to many relationships of each day columns to the User table. All the days column should be LookUp columns looking to the User table and allow multiple values.

 

If you have all those LookUp columns in the Course table, you can use a Gallery to display all the courses and add combo boxes bound to different columns (e.g. day1 column: Items = Choices(Course.Day1)) and set them allow multiple selections, then you will be able to select users in all the combo boxes. At last use a button to update the Gallery to the Course table.

ForAll(CourseGallery.AllItems, 
       Patch(Course, 
             ThisItem, 
             {Day1:Combobox1.SelectedItems,Day2:Combobox2.SelectedItems,...}
       )
)

 

For the last question, since days are columns of the Course table and allow multiple values, there is no way to bulk relate each column with a specific user.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
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 (3,446)