Required rule must have the respective row in the source file
What I'm trying to do is map a flat file that comes from Koerber's KMotion product. When I try to create the rule I get a "Required rule must have the respective row in the source file" prompt and I can't find any documentation on why that is.
Here's my Sample File data
PARTNER MAR08
SET 945
ROUTE MAR08
COMPANY W1
BEGIN
1020FMARIO CUST# 202207261777236 333941 945Q/DOMINO
1040WH Distribution Technology
1040DE MARIO CAMACHO FOODS
1040ST PROGRESSIVE FOOD SOLUTIONS LLC 91PRO8603006
1060REDIRECT CENTER 860 PICKENS INDUSTRIAL DRIVE
1070MARIETTA GA30062
11100220220726
11101020220726
11105220220725
1130H CPU CUSTOMER PICK-UP PP
2005000001
2010GM00007291482000172236
2010UC12/6 OZ CAN MARIO LARGE BLACK PITTED
2020CC240 240 0 CA073651214287VN7365121428 DEC012022
20503620221201
2005000002
2010GM00007291482000172243
2010UC12/5.75 OZ JAR MARIO SMT BUCKET
2020CC49 49 0 CA073651117069VN7365111706 FEB072023
20503620230207
2005000003
2010GM00007291482000172243
2010UC12/5.75 OZ JAR MARIO SMT BUCKET
2020CC71 71 0 CA073651117069VN7365111706 FEB062023
20503620230206
3010360 4562.4 LB
END
Here's where I am in my rule creation
{
"resourcePath": "",
"fileDefinition": {
"name":"SE5 Flat File",
"description":"856 Export for SE5",
"version":1,
"format":"fixed",
"fixed":{
"rowsuffix": "",
"rowDelimiter": "\n",
"paddingChar": " "
},
"rules": [
{
"name":"856",
"container":true,
"required": true,
"maxOccurrence": 1,
"children": [
{"maxOccurrence":1,
"required": true,
"elements":[
{
"name":"PARTNER",
"value":"MAR08",
"length":10
}
]
}
]
}
]
}
}
Here's the full error
Message: Required rule must have the respective row in the source file. Path: rules[0].children[0].PARTNER for line: 1
0
Comments
Jack Harris this is definitely not for the faint of heart. Here is a quick stab and hopefully gets you jump started to finish the rest. Here is the help article where some snippet examples can be found.
I was able to get that to work, but I ran into a new wall. Can you show me an example of a child of a child? This is what I have currently, but I'm getting an "Elements flagged as containers require at least 1 child element." error. It's weird because my child container does have an element.
Here's the rules:
And here's my sample file.
Jack Harris you can't have a container within the elements array. The elements array is just for fields within that row. You would need to move to under the child array.
Thank you for all the help you've given me so far, it's been really great!
So I'm making progress in that it's no longer erroring, but the lines aren't previewing. I did what you said with the child elements (I've been trying to figure out how that worked for days now) and it worked, kinda.
But the results don't have the Lines
This is the data that I'm processing for this.
As you can see, it goes through the Assigned Number (2005), Item Detail (2020), and the Description (2030). It does this for an indeterminate number of lines.
So far, I've figured out that I need all three to be in a container, but I haven't figured out yet what that container of containers is supposed to look like.
Here's the full "Lines" section:
I got it most of the way there with the below, but it's not iterating and I'm not sure what I'm missing.
Rule:
Sample:
Parsed Output (I'm also getting the "/r" again and haven't figured out how to get rid of it):
I'm expecting to see more 2005 iterations.
Jack Harris would be something like this:
Definition:
Input:
Output:
Do you know how to get rid of the /r?
Jack Harris I'm not sure how on the edi translation rules, but you could do this in a preSavePage script. See below.
Please sign in to leave a comment.