The client-side Action API doesn’t allow you to return data anywhere. This is unfortunate, but true.
This is why any client-side plugins that deal with data are built as Element plugins. Element plugins have their own Actions (defined in the element plugin itself, not as separate client-side actions). The code from such actions can then use instance.publishState() to push data to the element’s exposed states.
For an easy-ish to understand, open source plugin that demonstrates this concept, see my Fielder plugin (you can inspect the code and/or fork it):
For some context around the “Fielder” plugin, see Do a Search for a Thing's List of Fields (Introspection) - #3 by keith
It is unfortunate that the client-side Actions API doesn’t allow us to return values to the client-side workflow (like Server Side Actions can do for backend workflows). There are many Element plugins with actions that would be better implemented as purely as Actions, but since we can’t publish data anywhere, it’s a non-starter at the moment. (AFAICT, the client-side Actions API was conceived purely as a way to manipulate things in the DOM as they don’t have many other uses. You’ll note that they do not have a way to specify any exposed states and they do not receive the instance object (where we find the .publishState() and .triggerEvent() methods), put only their properties (field values) and the context object.