Is it possible to rewrite the contents of a table macro with a forge macro?

I am a developer with forge and would like to create a button macro that rewrites the contents of a table macro when pressed.
I am considering using the API to output the table macro as json data, rewrite the json, and load it, but if anyone knows of an easier way to do this, please let me know.

Thank you in advance.