How to set a state for a data type that has a list and a list of option sets?

Users can create their own projects and add team members to that project as well as select the team members’ roles.

I have an option set with the three roles and a data type called “Team” that has a project, a list of users and a list of roles.

When creating a new team, how do I set the custom state so that the role and the user are connected?

Hi there, @aspiretoelevate… if I understand your post correctly, the Team data type as you have defined it is not going to work because there is no association between the list of users and the list of roles. If a user can only have one role no matter how many teams/projects they are on, you could simply set a user’s role on the User data type, and you would be good to go. I’m guessing a user can belong to multiple teams/projects and have a different role on each team/project, though. So, you are likely going to need a new data type that stores the association between a user and each team/project as well as the user’s role on the associated team/project.

Anyway, just food for thought there, and I hope it helps.

Best…
Mike

Yeah exactly, the user will belong to to multiple teams/projects. How would I need to set that up to connect the role to the user?

I tried setting it up but can’t figure out how to set the state to save it in order to see if it works…

I have datatype called “project” which has a “name” and “order number”

I have an option set called roles with the three options: viewer, collaborator and admin.

And a data type called “team” with a list of “users”, list of “roles” and a “project”.

Is this the correct way to set it up? I don’t see how this would connect the user to a role within a team since its two separate lists…

As @mikeloc already said in his last post, you’ll need an additional datatype to connect the User to a Role and a Team.

So create a datatype called user_team_role (or something like that), with a field for User, a field for Role, and a field for Team.

1 Like