Flow.js with a csv file as input

#1

Hi, is there a way to use Flow.js (for example data-f-bind) to use in the model data that comes from a file (i.e. csv file) that the user uploads like in "input type=“file” id=‘myFile’ "? How can i read that data and use it in my model?

0 Likes

#2

Hi,

Unfortunately, Flow.js does not directly support end users of a simulation uploading data files into model variables.

However, as the author of a simulation, you can include data files in the model directory for use by all users. If this is what you are looking for this is the the easiest solution.

If you need the user to be able to upload data for a particular run, you could do custom JavaScript (using the FileReader API ) which to parse the data into a JavaScript variable. Then publish that variable to the model with FlowJs.

0 Likes