web stats
Mirth Community - View Single Post - Conditionally Edit CSV Help
View Single Post
  #2  
Old 06-17-2015, 10:20 PM
flyerman flyerman is offline
OBX.2 Kenobi
 
Join Date: May 2015
Posts: 68
flyerman is on a distinguished road
Default

I tested your code on Mirth 3.1.1.7461

Your code is working fine

mouse --> test


_______________
Can U put a few logger.info to confirm everything is correct

logger.info("msg['row'][1]['column1'].toString() before loop = " + msg['row'][1]['column1'].toString())
for(var i = 0; i< msg['row'].length(); i++) {
logger.info("i = " +i)
if (msg['row'][i]['column1'].toString() == "mouse") {

msg['row'][i]['column1']= "test";
}
}

logger.
info("msg['row'][1]['column1'].toString() after loop= " + msg['row'][1]['column1'].toString())

The log should comes out as
INFO (transformer:?): msg['row'][1]['column1'].toString() before loop = mouse
INFO (transformer:?): i = 0
INFO (transformer:?): i = 1
INFO (transformer:?): i = 2
INFO (transformer:?): i = 3
INFO (transformer:?): msg['row'][1]['column1'].toString() after loop= test

Last edited by flyerman; 06-17-2015 at 10:30 PM.
Reply With Quote