Hello! I am new at this and would appreciate help! I have a listener getting transaction fields from NetSuite that I need to send as an xml file to an ftp site. I keep getting the error "no footer found in the template". Here is my XML Parser Template:
<?xml version="1.0" encoding="utf-8"?>
{{#each data}}
customerservice@x
customerservice@x
customerservice@x
{{refnr}}
{{ponr}}
10339
BSN
{{name}}
{{street}}
{{street2}}
1234
{{zip}}
{{city}}
{{country}}
{{phone}}
Receiving
0031885552244
{{#each orderline}}
EXPORT
MS2
{{qty}}
{{partnr}}
{{Lrefnr}}
{{/each}}
{{/each}}
Can anyone help me resolve this error?
I should have said that I have tried adding into the file just below the header and also after . This does not resolve the error.
@beverlybishop can you provide a JSON sample output so I can play around with this in my environment?
@tylerlamparter Here is a screenshot of my window. Let me know what you need:
@tylerlamparter
{
"data": [
{
"qty": "quantity",
"partnr": "item.name",
"Lrefnr": 999,
"refnr": "tranid",
"name": "entity.name",
"street": "shippingaddress.addr1",
"street2": "shippingaddress.addr2",
"zip": "shippingaddress.zip",
"city": "shippingaddress.city",
"country": "shippingaddress.country.internalid",
"phone": "(917)494-4476",
"ponr": "otherrefnum"
}
],
"importName": "Klairy Testing",
"connectionName": "FTP Connection",
"uuid": "x",
"settings": {
"integration": {},
"flow": {},
"flowGrouping": {},
"connection": {},
"import": {}
}
}
@beverlybishop where does the error happen? When you try to save it or when you try to run it? Or when your provider picks up the generated xml?
@tylerlamparter When I run the flow.
@beverlybishop the issue is due to the {{#each}} being used for a xml tag that has to be underneath a tag that can handle multiple orders. For example, we usually see a plural tag where multiple orders can live underneath it. See below screenshot. Without that, we would be creating invalid xml if there were multiple orders because we can't have a singular tag not underneath a header and footer tag.
<?xml version="1.0" encoding="utf-8"?>
{{#each data}}
customerservice@x
customerservice@x
customerservice@x
{{refnr}}
{{ponr}}
10339
BSN
{{name}}
{{street}}
{{street2}}
1234
{{zip}}
{{city}}
{{country}}
{{phone}}
Receiving
0031885552244
{{#each orderline}}
EXPORT
MS2
{{qty}}
{{partnr}}
{{Lrefnr}}
{{/each}}
{{/each}}
However, if you need to only send 1 transaction per file, then you could modify your setup to look like this:
<?xml version="1.0" encoding="utf-8"?>
customerservice@x
customerservice@x
customerservice@x
{{data.0.refnr}}
{{data.0.ponr}}
10339
BSN
{{data.0.name}}
{{data.0.street}}
{{data.0.street2}}
1234
{{data.0.zip}}
{{data.0.city}}
{{data.0.country}}
{{data.0.phone}}
Receiving
0031885552244
{{#each data}}
{{#each orderline}}
EXPORT
MS2
{{qty}}
{{partnr}}
{{Lrefnr}}
{{/each}}{{/each}}
You also would need to enable "skip aggregation" on the import step.
Thank you so much for helping a newbie!! Any chance you can point me to an article to learn about the data.0.x tags?
@beverlybishop we have this (https://docs.celigo.com/hc/en-us/articles/360038857412-Literal-segments-and-handlebars-identifiers) which may help some. In general, if you have an array of data, you need to either loop through the array and perform some action or you need to specify what object index within the array you would like to pull out. In this example, you are given an array of data and there will only ever be 1 object in the data array because you enabled "skip aggregation". Since there will only ever be 1 object in there, you need to specify the path to the first object, which is 0. 0 index is always the first index when working with json. Hopefully that helps
Hi again, @tylerlamparter,
I'm afraid that I still don't have this working and can't figure out what I'm doing wrong. With this:
<?xml version="1.0" encoding="utf-8"?>
customerservice@x
customerservice@x
customerservice@x
{{data.0.refnr}}
{{data.0.ponr}}
10339
{{data.0.servicelevel}}
{{data.0.name}}
{{data.0.street}}
{{data.0.street2}}
{{data.0.street}}
{{data.0.zip}}
{{data.0.city}}
{{data.0.country}}
{{data.0.phone}}
{{data.0.AttnName}}
{{data.0.CPhone}}
{{#each data}}
{{Lrefnr}}
EXPORT
Relievant MS2
{{qty}}
{{partnr}}
{{Lrefnr}}
{{/each}}
I get these results:
<?xml version="1.0" encoding="utf-8"?>
customerservice@x
customerservice@x
customerservice@x
SO7287
Test1
10339
35022-4527
US
EXPORT
Relievant MS2
3,2,1
FG 0046 Additional Level Access Instruments,FG 0060 Access Instruments,FG 0043 RF Probe
If I add the {{each orderline}} and {{/each}} exactly as you have it in your example, I don't get any orderline data. I can't figure out how to get the data to repeat all of the order lines.
...
Also, I can only get the Ship Country and Ship Zip to come through from NetSuite. What am I doing wrong?
Appreciate your help so much!
@beverlybishop can you join office hours tomorrow? Someone may be able to help you there since it seems like you have multiple setup issues here. Here is the sign up link: https://zoom.us/meeting/register/338c30f6ce7573eacde7dc3c8da9331e#/registration.
What does your input data look like now? The sample you provided before didn't include any order line data. Why do you have a transform step on your initial NetSuite source step? Can you screenshot that? That could potentially be setup incorrectly as well which may be leading to issues here.
I have signed up for office hours today. Thanks.
Here are screenshots of my current process. I removed the transform step. I'm not currently using the lookup, but I will need to to get just the item numbers to flow through without the descriptions.
@beverlybishop were you able to get help in office hours?