Hi,
you obviously want to change/edit/update this csv-file during fieldwork.
Though I do not see any difference in adding lines to the csv file or adding an expression in the survey
here is a solution.
I use the script "Papaparse.js"
Here my csv-file:
email,color
email1@example.org,red
email2@example.org,blue
email3@example.org,yellow
In a question of type "short text" (or "multiple short text", if you want to capture and show more attributes) I entered the email address as default answer.
And this script
Download the library or enter fron cdn.
Code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.js" ></script>
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:complete',function() {
var email=$('#question{QID} input[type="text"]').val();
Papa.parse("https://www.myserver.com/test.csv", {
download: true,
header: true,
skipEmptyLines: true,
complete: function(results) {
for (i=0; i < results.data.length; i++) {
if (results.data[i].email==email) {
$('#question{QID} input[type="text"]').val(results.data[i].color);
break;
}
}
}
});
});
</script>[/i][/i]
Now you can show the content of the text question in your further survey.
Joffm