Phoenix ecto save foreign key from selected list

Hey there,
I am trying to set a a team - user relation where a user can be in a team.
I have the relation set up and in the db I have the field for team id for the user.
I also have the teams as options for the user set up when we create a user, with name and id.
How could I save that id to that field that was created by association the 2 tables?
I used these resources:
https://hexdocs.pm/ecto/associations.html#content
https://stackoverflow.com/questions/36698192/how-to-create-a-select-tag-with-options-and-values-from-a-separate-model-in-the