web stats
Mirth Community - View Single Post - JSON Looping question
View Single Post
Old 05-21-2019, 01:53 PM
agermano agermano is offline
Mirth Guru
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,005
agermano is on a distinguished road

Your first issue is that your counter needs to be incremented inside the while loop instead of after if you're using an index (which isn't necessary, see below.)

The += operator appends to an XMLList, but doesn't work with javascript arrays.

You have to create a new object each time.

I would change your template to an empty array:

"geneList": [],
And then try this:

var geneListQuery = executeCachedQuery(dbConn, geneQuery);

        gene: geneListQuery.getString('hgnc_symbol')
Reply With Quote