I have a complex build I’m working on and I need to make some things happen I am hoping you can assist with.
Basically, I have a External API looper I am using to grab data from a CSV file. That data will feed 4 charts and I have that working as expected (the Pokemon video and others using loopers with Charts were a big help). But What I need to do is change the path after the endpoint based on a selection made by end users in the front end.
There will be 15 different CSV files and based on the selection a user makes from a dropdown I will build, I wanna update that path dynamically - without a page reload . I can handle the JS needed to detect what selection was made and grab the value of that selection but, I need help figuring out how to tell the looper’s path to update based on that selection - again, without a page reload.
So the experience would be:
-
The user selects option 1 from a drop down and it gets the CSV path associated with that option (well, what I’m calling option 1 would be the default CSV on initial page load so that something is there to begin with).
-
They then select option 2 from that same drop down and my JS would watch for that switch and get the value of that option.
-
I could store that in a cookie or whatever - no problem. But what I don’t know how to do is tell the looper itself that this change has occurred and it should update the path of the endpoint and display the data found there dynamically - without a page reload. So, when the the selection s made, the charts re-populate with a new data set from a different path to a CSV I have prepared.
Is there a method I could employ that would do that? (Please say yes :^) )
I’ve scoured the forums and looked through the docs. And I’ve asked Grok and GPT - they seem to think its possible but I don’t have confidence in their solutions yet because this functionality is not really documented as far as I can tell so I fear those tools may be lacking a complete picture for implementing this properly.
Can you help and provide any guidance here?
I know this is an advanced topic but I think it would make a great addition to the video series about external APIs. I could see a lot of uses for something like data visualization based on user selected options.
Thanks so much in advance for the help!