web stats
How to retrive a value in a segment when pass as a parameter - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2010, 06:22 AM
Benzo Benzo is offline
OBX.1 Kenobi
 
Join Date: May 2010
Location: Québec Canada
Posts: 35
Benzo is on a distinguished road
Question How to retrive a value in a segment when pass as a parameter

HI all

My function is built, In the transformer i call it with the segement as parameter

Code:
for (var i=0;i< msg.children().length();i++)
{
	var curSeg =msg.children()[i];
	if (curSeg.name()=="PID")
	{
		WritePid(curSeg);
	}
}
But in the function when i try to get the value of the PID.2.1 in my variable i got nothing in it

Code:
var vNam = msg['PID']['PID.2']['PID.2.1'].toString();
If i use logger to show me the value of msg i got this

Code:
[2010-07-30 11:38:38,235]  INFO  (transformer:?): mesg.:<PID><PID.1><PID.1.1>1</PID.1.1></PID.1><PID.2><PID.2.1>2222225832</PID.2.1><PID.2.2>M</PID.2.2><PID.2.3>ON</PID.2.3></PID.2><PID.3><PID.3.1>50-3006787</PID.3.1></PID.3><PID.4/><PID.5><PID.5.1>IT TESTING</PID.5.1><PID.5.2>STG5832M</PID.5.2><PID.5.3>T</PID.5.3></PID.5><PID.6/><PID.7><PID.7.1>19660322</PID.7.1></PID.7><PID.8><PID.8.1>F</PID.8.1></PID.8><PID.9/><PID.10/><PID.11><PID.11.1>32 CANELLI HEIGHTS COURT</PID.11.1><PID.11.2>THORNHILL</PID.11.2><PID.11.3>ONTARIO</PID.11.3><PID.11.4>ON</PID.11.4><PID.11.5>L6T5M3</PID.11.5></PID.11><PID.12/><PID.13><PID.13.1>(905)886-3918</PID.13.1></PID.13></PID>
How can i retrive the value ?

Thanks again for your help
Benzo
Reply With Quote
  #2  
Old 08-02-2010, 07:33 AM
Benzo Benzo is offline
OBX.1 Kenobi
 
Join Date: May 2010
Location: Québec Canada
Posts: 35
Benzo is on a distinguished road
Default

Ok i have found It
I just have to skip the ['PID'] and writh the code line like this


VAR NAM = msg['PID.2']['PID.2.1'].toString();
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation