Skip to content

Instantly share code, notes, and snippets.

@byronferguson
Created July 22, 2015 17:57
Show Gist options
  • Save byronferguson/778b52367b39418de4a6 to your computer and use it in GitHub Desktop.
Save byronferguson/778b52367b39418de4a6 to your computer and use it in GitHub Desktop.
Query Loop
var pageInfo = [];
var questionInfo = {};
// Loop over the questions to fill in the other aspects (options / responses)
for(var record in local.results) {
structClear(local.questionInfo);
structInsert(local.questionInfo, "question", record);
structInsert(local.questionInfo, "options", record.qID);
structInsert(local.questionInfo, "responses", 1);
arrayAppend(local.pageInfo, local.questionInfo);
}
@bdw429s
Copy link

bdw429s commented Jul 22, 2015

var pageInfo = [];
for(var record in local.results) {
    local.pageInfo.append({
        question : record,
        options : record.qID,
        responses : 1
    });
}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment