Calculation just ids from a relation

i need a calculation of just the ids from a relation (references to other table) here my experiment
calculate :my_relations_reference_dis, {:array, :string}, expr(my_relation.reference_id) do
load [:my_relation]
public? true
end
calculate :my_relations_reference_dis, {:array, :string}, expr(my_relation.reference_id) do
load [:my_relation]
public? true
end
i need use this calculation to a query, just need the list of ids to check if an input id is in the list
1 Reply
ZachDaniel
ZachDaniel5mo ago
No need for load statements on expression calculations its inferred
calculate :my_relations_reference_ids, {:array, :string}, expr(list(my_relation, field: :reference_id))
calculate :my_relations_reference_ids, {:array, :string}, expr(list(my_relation, field: :reference_id))

Did you find this page helpful?