Help with mapping NetSuite Export to REST API

Comments

4 comments

  • Amanjot Singh Group Product Manager
    Engaged
    Answer Pro
    Great Answer
    Celigo University Level 4: Legendary

    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. 

    0
  • PaulS
    Celigo University Level 1: Skilled
    Awesome Follow-up
    Engaged

    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.

    0
  • Scott Henderson CTO
    Celigo University Level 1: Skilled
    Answer Pro
    Top Contributor

    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.

    0
  • PaulS
    Celigo University Level 1: Skilled
    Awesome Follow-up
    Engaged

    Thanks, both of you!  I will leave it as it is and do some testing! 

    0

Please sign in to leave a comment.