Help with mapping NetSuite Export to REST API
I have setup a saved search to return items from NetSuite that I want to import into a 3rd party system using their POST API. I get the data from NetSuite and I have defined a hook to convert the data into the format I need (as well as removing unwanted records) before sending it to the destination import. The hook sends the data over to the import in a one to one element map to the API requirement. Below is the incoming NS data and the "function output":
When I go to the destination to work on the mapping, I get no fields to map. I am also using a "saved search" to return the records that I want and in the element format/order that I want. I really want to map the output function elements directly to the sample of the API that I entered on the destination Rest API and I would literally be done. Below is the destination mapping view:
Any help would be appreciated.
Comments
Hello Paul,
For the function output you shared, the input to the import mapping would be as shown in the screenshot below. You won't get the "data" field as the parent element. If your intention is to send the data as-is (shown in the screenshot) to the REST API, maybe you don't need the mapping at all.
So, you are saying that I have the data coming from the export already formed correctly for the API, that I just "pass it through"? I have not tried that nor am I sure of how to do that. I would need to remove the "data:" and just send the array. Not sure how Celigo is going to break up the data in pages, but as long as an array is sent the API will accept it.
To repeat what Aman is saying, the field mappings are not required for your use case since you are already doing the field mapping translations/logic in your hooks, and if you simply delete all the field mappings, then the payload to your REST API should be each individual record/object one at a time.
The "data: []" container variable that you see in the hooks input/output is only there for the hooks. i.e. we do this to force users to author efficient batch based hook logic, but the "data" variable itself does not get sent to the REST API.
Thanks, both of you! I will leave it as it is and do some testing!
Please sign in to leave a comment.