Passing data from html element to database

Hi,

I have an html element that analyses the colours of a user-uploaded image. Example found here: https://codepen.io/jonas-majidi/pen/GRLWmeQ

The element returns 25 of the most dominant colours as a list (text), and I would like to save this list in order to display these colours on the ‘post’ page. However, I can’t seem to figure out how to do this, I’ve tried adding a js element that references the html element, and using the js in a workflow. I must be doing something wrong, because it’s not working.

Could anyone guide me? Thank you!