Run/replace get data from external API on button click

Trying to run a workflow that resets the customstate of a group to the data of a external API (math.js plugin) every time the button is clicked. The element is a text element which’s value is simply the custom state.