E9.2 Defining the ORCH input

Stank1964

Well Known Member
I need to create an ORCH where the input is defined, I am not the person defining it. I need to map this to the input as a starting point. The request follows. My question is how do I define the ORCH input for the deliveryMode.code variable for example?

{
"code": "6000006015",
"entries":
[
{
"entryNumber": 0,
"productCode": "E02852",
"qty": 1,
"discountedUnitTotalPrice": 35.01
},
{
"entryNumber": 1,
"productCode": "E00811",
"qty": 1,
"discountedUnitTotalPrice": 44.91
},
{
"entryNumber": 999,
"productCode": "SHIPPING",
"qty": 1,
"discountedUnitTotalPrice": 9.95
}
],
"deliveryMode":
{
"code": "Ground"
},
"shippingAddress":
{
"jdeAddress": "331358",
"firstName": "Carmine",
"lastName": "Di Gruttola",
"line1": "701 E 36th Ave",
"phone": "+1 907-563-0658",
"postalCode": "36853",
"shortState": "AL",
"town": "Dadeville"
},
"billingAddress":
{
"jdeAddress": "331356"
},
"orderType": "SN"
}
 
So you have 3 things in here, name/value pairs (type string in input), arrays (type array), and json objects (type Object). I wish they'd allow for furrther definition of json objects within the inputs but they don't, so we're stuck "remembering" the structure of each object, and accessing the object's name-value pairs using scripting.

Attached a quick POC, you can input your json as raw input to the orch and see the outputs.


1686064240623.png
1686064311752.png
 

Attachments

  • HC_OR_POC_ComplexJsonInput_R1.zip
    1,013 bytes · Views: 5
Hi Dave.

In my example, deliveryMode sits outside of the entries array. For this reason, the answer is to define deliveryMode as an array and put "code" inside of it, like so. I did the samne thing with the billingAddress input and you can see that too in the screen shot.

1686065007706.png
"code"
 
Wait a minute, I never tried to define the input as an object....
 
Back
Top