It looks like your index.html
doesn’t have the behavior you’re describing. @Heath recommendation there was to build the functionally you desire outside of Losant in an index.html
file. Then, we’d be happy to guide you as to how to get that into the Custom HTML Block.
The resources linked earlier in this post are the best resources if you have troubles building an independent index.html
file for this:
The way you would do this with the
<script>
tag in HTML. Then with a button, you can use theonClick
HTML Attribute to run a JavaScript function or use theonclick
event handler in your JavaScript code.
Then in the JavaScript function, you can use the Fetch API to get data from an API.
In terms of Losant Examples, the best, related example is here:
In the example, the table is being generated from input.queries.cost
. To solve this problem, you would have to update the Javascript, to do what you desire.