The script itself initiates the load of an excel sheet - converts it to json - and writes the excel content in json to the visualizer window. I now want to grab that data (the converted excel) and use it in a subsequent api call. so - I need to be able to pass the contents of what the js has done to an environment variable to persist it for future calls.
Thanks for looking at this with me btw. I could be going about it wrong - but I’m using multiple script libraries that are set to script src above. I do get the response I want in the response window on the visualizer. And I have to use visualizer becuase the user initiates the file upload with a button. Once they do - the excel sheet is parsed to Json and displayed in the response window. If I can set it to a variable - I can use that response in a subsequent post.
So where I am now:
Visualizer works - user clicks button - loads excel sheet from computer
Script is converting the xlsx format nicely to json
Json from the spreadsheet is showing in the visualizer window
Where I’m stuck - is persisting that json data into an environment variable to be used by another call.
I’m doing this the other way - passing environment variables to other script libraries such as autotable, jspdf, datatables - and use them extensively - especially the responseId because this keeps all my tables as having unique names that are the invoked in functions. Here is the result of that work. And the reason was - I can reuse the code and only change the handlebars without worrying about changing table ids or anything else in the scripts!
Heck - I even tried putting all of my var template ’ into an environment variable and just calling it - which would have given me a single place to change scripts affecting hundreds of calls - but that didn’t work. Idea was - just have either lodash or handlebars in the test window - and leave all the js and jquery elsewhere…
Another option is I could just write a function to post directly once the file has been uploaded - but then I miss out on the error messaging postman supplies I think… but that is for tommorow.