blueprint(1).json (140.1 KB)
Okay so I am trying to make a more robust Quickbooks to Shipstation integration.
I plan on replacing Datastore with mySQL but for now this is the flow:
-Initial Datastore populated by different scenario, stores ID-KEY and a boolean for processed true/false.
- This scenario reads for processed false
- Gets invoice Details and confirms balance 0
- Adds Customer Info from Invoice ID
- Iterates “Line” which contains all line items
- Aggregates them all back into an array
- Sends to Shipstation to create an order
- Updates Datastore to mark Key as Processed True
I’ve got everything working okay, except for the “Unit Price” section.
Quickbooks seperates Single line items and group items by keeping single line in the top level array then group lines in a sub array.
For Example:
Line[]
Itemname: single line item
Amount: 9
Unitprice: 9
QTY: 1
line[]
itemname: Group Item 1
Amount 0
unitprice null/blank
qty 1
line[] *(This is a sub-array under the first line[])*
Itemname: single line item 2
Amount: 9
Unitprice: 9
QTY: 1
Itemname: single line item 3
Amount: 9
Unitprice: 9
QTY: 1
Itemname: single line item 4
Amount: 9
Unitprice: 9
QTY: 1
In the above scenario the correct unit price for Group Item 1 should be 9+9+9+etc…
The price for the sub-array items are not always static, first can be 1 then next 3 or whatever.
So far through expressions I’ve only been able to grab the first value of the sub-array.
So Group Item 1’s unit price would show as 9. Which is incorrect.
What can I do to get the correct 9+9+9+etc value?