How can I retrieve attributes from a resource record
Which is the preferred way to extract attributes from an
Ash
record?
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.1 Reply
The attributes will be on the record by name
i.e if you had an attribute
:first_name
you'd say record.first_name
If you want to get all attribute values, you could do something like this: