cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrunoT_CH
Regular Visitor

Model Driven PowerApps CDS Assigning multiple users to a record

I struggle currently with building a data field in CDS for assigning multiple users to a task. I turn circles here, anybody got an idea how to define this data field? 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @KvD1995, sorry for my late reply.
You can't simply add a field to associate multiple users, since a field represented by simply a column in a table. You'll need to relate users to a project and since users can be associated to different projects, in database terms, you'll need a N-N (many-to-many) relationship between Project and User. In Dataverse, this can be achieved by the two methods in my previous posts. The 2nd approach is by creating a custom table (say "Project User") with two fields/columns; a lookup to User and another lookup to Project. Make sure you configure the forms and quick create forms on that table to include the 2 lookups. Then add a subgrid of "Project User" to the project form and your users will be able to add new records of users associated to the project.

Hope this makes sense...

View solution in original post

8 REPLIES 8
HSheild
Super User
Super User

Hi @BrunoT_CH 

 

In CDS there can only officially be one owner of a task or any record in the system for that manner. This is through the owner field which is a lookup to the User entity.

 

If you want to have a task completed by multiple people you might want to look at having multiple tasks so that each user has one.

Alternatively, you could create a one to many relationship between Task and User but you would also need some other configuration throughout the system to manage views like My Tasks.

 

Hope that all makes sense 

EricRegnier
Super User
Super User

Hi @BrunoT_CH,

To supplement @HSheild and to add additional options:

1) Assign the task to a Team and add the users that needs to complete the tasks to that team. This can be a good option if the users of the teams are most of the time static

2) If you use multiple tasks, one per user, then suggest to link the tasks to one-another to know they're the same. That would enable you to build logic around it if need be such as marking the overall work as complete only once all the tasks by all users are done. You can link by adding a relationship or a field with a unique value/key among them

3) You can use Connections to identify the owners of a task. This can be done by configuration without modifying the entities. More on Connections:

Hope this helps!

 

BrunoT_CH
Regular Visitor

Dear Eric, der HShelid

Thank you for your inputs. But maybe it is not clear formulated, I try to create an entity which stores a record per "Project", this project has an owner. So far so good, this is working. But, I'd like also to add Project members to that record (0 - 15 persons) but I'd like them to be added similar like the

Seems like there’s an issue with the post...the last sentence is cut. But if I understand, you want to add/assign multiple users to a Project record and not necessarily use tasks which you can do in two ways:

1) out of the box N-N (many to many) relationship and add the sub grid on the project form. Easiest option but more limited.

2) create a custom N-N relationship with a junction entity. 1-N between project and the junction entity and and other 1-N between project and user. Add a sub grid of the junction entity to the project form. Requires additional entity but more flexibility as the relationship records can have additional properties/fields (e.g. member type)

hope this little makes sense...

Hi Eric

Many thanks, indeed the two approaches make sense. I'll try that out. Feedback follows. BR 

KvD1995
Helper I
Helper I

Hi Eric, I  also want a CDS field in my model driven app for the entity project, where I can add multiple users. Could you explain more in detail how the second approach with the junction entity works?  

Hi @KvD1995, sorry for my late reply.
You can't simply add a field to associate multiple users, since a field represented by simply a column in a table. You'll need to relate users to a project and since users can be associated to different projects, in database terms, you'll need a N-N (many-to-many) relationship between Project and User. In Dataverse, this can be achieved by the two methods in my previous posts. The 2nd approach is by creating a custom table (say "Project User") with two fields/columns; a lookup to User and another lookup to Project. Make sure you configure the forms and quick create forms on that table to include the 2 lookups. Then add a subgrid of "Project User" to the project form and your users will be able to add new records of users associated to the project.

Hope this makes sense...

View solution in original post

KvD1995
Helper I
Helper I

Hi @EricRegnier, thanks for your solution. It's working!! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,426)