Issue with IF function

If you have a new question you’d like our support staff to post a response to, please visit our customer community, Data Security Insiders, to pose the question in our Discussion Boards. We have a thread “Ask Our Tech Experts” that our support team monitors on a regular basis, or you can start a new discussion where other GoAnywhere users and support staff can weigh in. Log in or create your new account at

If you need an immediate response, please create a support ticket or contact our support team by email at [email protected].
2 posts Page 1 of 1


Posts: 5
Joined: Mon Mar 24, 2014 9:11 am

Post by dhascup » Fri Apr 01, 2016 8:53 am
My IF function is not working properly

In the productType "CA" comes out as it should
In the packagingType "PK" comes out when it should be "CT"
They both refer to dataItem[7]

Code: Select all
<element name="globalAttributes">
									<element name="productType" value="${dataItem[7]}" trim="both" />
									<element name="globalClassificationCategory" trim="both">
										<element name="code" value="${dataItem[58]}" trim="both" />
									<element name="gtinName" value="${dataItem[9]}" trim="both">
										<attribute name="lang" value="en" trim="both" />
									<element name="brandName" value="${dataItem[5]}" trim="both" />
									<element name="brandOwnerGLN" value="${dataItem[6]}" />
									<forEach inputRowSetVariable="${dataNetContent}">
										<if test="${dataNetContent[1]} eq ${dataItem[2]}">
											<if test="${dataNetContent[2]} eq ${dataItem[3]}">
												<element name="netContent" value="${dataNetContent[3]}" trim="both">
													<attribute name="uom" value="${dataNetContent[4]}" trim="both" />
									<element name="packagingType" trim="both">
										<element name="code" value="${If((dataItem[7] == "CA"), "CT", "PK")}" trim="both" />

See attachment for captured result

Capture.PNG (15.62 KiB) Viewed 2552 times


Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Wed Apr 06, 2016 10:37 am

More than likely there are some spaces in the data. Please review and/or remove them and let me know.

Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1