Ash FrameworkAF
Ash Frameworkโ€ข3y agoโ€ข
4 replies
tommasop#2001

How can I retrieve attributes from a resource record

Which is the preferred way to extract attributes from an Ash record?

record = App.Model |> Ash.Query.for_read(:last) |> App.read_one!

# how to get attributes from it?
record.attributes ????


Must it be done through Ash.Resource.Info or through Ash.Changeset or it should not be done alltogether ๐Ÿ™‚

The use case is that I create a record from an external api call and in the same flow I must send a sync to another external api.
I must use the record attributes instead of the received attributes because sometimes attributes coming from the first api are missing.
I need something like Ash.Changeset data or attributes but for the record.
Was this page helpful?