Automatic field update

The problem I’m having is …
Select 2 only recognizes the first line of select 1 …
Type…

Result of select 1 = Brings all the results of a column
Result of select 2 = You are only returning the result of the first row of select 1 …

I made some adjustments, but to no avail …

select 1: cod_cliente = Repo.all(from(c in Cliente, select: {c.fantasia_cliente, c.cod_cliente}, order_by: [c.fantasia_cliente]))

select 2: tipo_cliente = Repo.all(from(c in Cliente, select: c.tipo_cliente, where: c.cod_cliente == ^elem(List.first(cod_cliente),1))) |> List.first()

In my form.html …
I’m asking him to get select 2 and update the field …
More like always, only the result of the first line of select 1 returns me

How should it be?
In javascript, it will return me the full 1 select tbm! …
I know I can not, escape from javascript …
But I’m starting to think my query is wrong.