Skip to main content

Throwing an Error using Post Submit Hook

Comments

3 comments

  • Scott Henderson CTO
    Answer Pro
    Top Contributor

    I think it would help if you posted the exact HTTP response body so we can see what you are dealing with (a screenshot of postman would work), and then please also share a screenshot of your export or import configuration.  There are a bunch of fields in the export/import bubble drawers to handle non standard API response patterns.

    0
  • Anek Porwal NetSuite Integration Whiz
    Engaged
    Celigo University Level 4: Legendary

    Hi Scott, thanks for taking out your valuable time and responding to me.

    I am attaching the API response screenshot below for reference.

    I was facing the challenge because the API is designed such that it gives 200 Status Codes for all the requests (Valid & Invalid). The Error Code and Message are sent in the body field. So It is impossible to know when a request is Invalid because it shows as success in the IO. So I want to throw an error whenever there is a response body with an error message & code. I have successfully accomplished it with a post-submit script (screenshot attached below). If anyone is facing the same challenge they can modify the script as per their needs and take a leaf from it. 

    Note: Also in the output filter they need to map (pause till some fix ths error).


     
     
     
    0
  • Scott Henderson CTO
    Answer Pro
    Top Contributor

    We have native fields in the import to support this use case.  See following pic.

    0

Please sign in to leave a comment.