web stats
Mirth Community - View Single Post - Repeating field blank or not blank conditions
View Single Post
  #2  
Old 01-22-2020, 05:46 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,360
cory_cole is on a distinguished road
Default

We need to trigger code when CON.3.1 = "Success" & CON.11.2 = "1".

CON|1||RandomValue|||||||
CON|2||Success||||||||10^1| (this is the segment we want to trigger the code)

for each(con in msg['CON'])
{
if(con['CON.1']['CON.1.1'].toString() == 'Success' && con['CON.11']['CON.11.2'].toString() == '1')
{
code here
}
}


Actually, I would get rid of the internal if and do this...


for each(con in msg['CON'])
{
if(con['CON.1']['CON.1.1'].toString() == 'Success' && con['CON.11']['CON.11.2'].toString() == '1' && con['CON.10']['CON.10.1'].toString() == '10')
{
code here
}
}

Last edited by cory_cole; 01-22-2020 at 05:49 AM.
Reply With Quote