Q: I need to handle orders that have items attached, where each order can have more than one item. On my NetSuite export, I’m using a transform to change the structure to this “one-to-many” relationship between an order and its items. However, my HTTP request body has two objects for the same order, each with one item, instead of one order object with two items inside. Essentially, I need an array of orders with an array of items in each order.
A:
-
Uncheck the Group rows checkbox. If it’s checked, it will group all items from your export’s saved search to the same order. It groups your orders into an outer array, so that you have an array of order arrays. The reason why you are seeing multiple objects for the same order and each object has one item is because each object represents a line in the saved search.
You can use the Transform rules mapping process or a JavaScript hook to restructure your data, but you’ll still need to construct your HTTP Request Body in your HTTP call.
- Set the One to many field on your export to No. This will treat each line as a single record.