cancel
Showing results for 
Search instead for 
Did you mean: 

concatenate two field values in Xpath and compare the value

Former Member
0 Kudos

Hi All,

I need to provide the condition in X path in receiver determination.The condition is as below :

Consider the input fields are field 1 and field 2 i need to concatenate the two values of field1 and field 2 in Xpath expression

and compare the value and if the concatenated values is equal to certain value then I need to pass it to the receiver.

The Xpath condition example is :

field 1 has value L and field 2 has a value I i need to concatenate the value of field 1 and field 2 in X path as concatenate field1 and field2 (LI) equals LI then i need to pass it to the Receiver.

Request you to please let me know if this is possible in Xpath condition in Receiver Determination.

Thanks and Regards,

Rajesh Naidu

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

concat ("L","I")

Yes concat the two fields and doing comparison in the RD is possible.

Former Member
0 Kudos

Hi Baskar do i need to insert as concat(field1,field 2) = LI in Xpat ?Please let me know if iam wrong

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Dont understand your question. If you get field value 1 and 2 separate at run time , then you have to insert concat function to concat the string and check the value equals LI or not in the receiver determination. That is right.

Former Member
0 Kudos

Yes gopal

Former Member
0 Kudos

Hi ,

The condition in the Receiver Determination is given as below :

concat (/ShipmentStatusMessage/ShipmentStatus/ShipmentStatusEvent/EventCode,/ShipmentStatusMessage/ShipmentStatus/ShipmentStatusEvent/ContainerStatus) = API

if the value of /ShipmentStatusMessage/ShipmentStatus/ShipmentStatusEvent/EventCode = AP

/ShipmentStatusMessage/ShipmentStatus/ShipmentStatusEvent/ContainerStatus = I

I need to concatenate and comapare the value with the target API and if the condition is met it needs to pass to the receiver .

I tried to test it using test configuration but it is giving errror at Receiver Determination.

Request if any one can suggest if any changes are required in Xpath.

Thanks

Rajesh

Former Member
0 Kudos

use this:

/ShipmentStatusMessage/ShipmentStatus/ShipmentStatusEvent [ concat(EventCode,ContainerStatus) = 'API' ] EX

(use square brackets before concat and after 'API'.. )

Thanks

Amit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rajesh,

as if you want to concat and then check for value and then want to route this message to any particular Receiver system then..

as of my understanding.. before receiver determine you cannot run mapping and hence you will be not able to use any logic from mapping in this problem..

and even if you want to check value based on concat value of two different source field then following is the option..

suppose

you have 2 source field.. Field1 and field2.

in that case.. you can set two condition and use AND ..like

if at the end you want to check the concatenated value is "SDNSAP" or not..? then

you can put condition field1="SAP" AND field2="SAP" ? and put your receiver system..

I mean this just a option in case if you know from which field you are going get which value.. then instead of concat you can put two different condition combined by AND.. and use it for path to determine receiver system..

Thanks,

Bhupesh