The script part of the HTML statement in the template component, how to reference the data from the previous node

could you perhaps provide a copy of the flow your using?