Answered

Post Submit hook to return created record Id

We are using a flow to create a custom object record from NetSuite to Zendesk, we would like to get the record Id we created in the same flow using a Post Submit hook, can we get an example for this script?

for example - NetSuite customer to Zendesk organization is using 'updateOrganizationIdInNetSuite'

0

Comments

2 comments
Date Votes
  • PostSubmitHook function contract looks like following : 

    /*
    * postSubmitFunction: * * The name of the function can be changed to anything you like. * * The function will be passed an 'options' argument and a callback argument. * The first argument 'options' has the following structure: { bearerToken: '', _importId: '', _connectionId: '', _integrationId: '', _flowId: '', preMapData: [], postMapData: [], responseData: [], settings: {}, configuration: {} } * 'bearerToken' - a one-time bearer token which can be used to invoke selected integrator.io API routes. * '_importId' - the _importId of the import for which the hook is defined. * '_connectionId' - the _id of the connection linked to the import for which the hook is defined. * '_integrationId' - the _id of the integration linked to the import for which the hook is defined. * '_flowId' - the _id of the flow linked to the import for which the hook is defined. * 'preMapData' - an array of records representing the page of data before it was mapped. An individual record can be an object {}, or an array [] depending on the data source. * 'postMapData' - an array of records representing the page of data after it was mapped. An individual record can be an object {}, or an array [] depending on the data source. * 'responseData' - an array of responses for the page of data that was submitted to the import application. An individual response will have the following structure: { statusCode: 200/422/403, errors: [], ignored: true/false, id: '', _json: {}, dataURI: '' } * 'statusCode' - 200 is a success. 422 is a data error. 403 means the connection went offline (typically due to an authentication or incorrect password issue). * 'errors' - [{code: '', message: '', source: ''}] * 'ignored' - true if the record was filtered/skipped, false otherwise. * 'id' - the id from the import application response. * '_json' - the complete response data from the import application. * 'dataURI' - if possible, a URI for the data in the import application (populated only for errored records). * 'settings' - a container object for all the SmartConnector settings associated with the integration (applicable to SmartConnectors only). * 'configuration' - an optional configuration object that can be set directly on the import resource (to further customize the hooks behavior). * * The function needs to call back with the following arguments: * 'err' - an error object to signal a fatal exception and will fail the entire page of records. * 'responseData' - the responseData array provided by options.responseData. The length of the responseData array MUST remain unchanged. Elements within the responseData array can be modified to enhance error messages, modify the complete _json response data, etc... */ myPostSubmitFunction = function (options, callback) { return callback(err, returnResponseData) }

    Note that if you wish to use the created record Id further, you can tie the import with another export/import on the IO in the same flow. Response data is available along with the id for further processing.
    0
  • Hi, Guy!

    I asked some of our subject matter experts about your question, and they suggested that you join them for office hours so that they can walk through this and troubleshoot it with you. Office hours are Tuesdays and Thursdays, 10:00am-11:00am Pacific, and you can register for them here

    Hope this helps!

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post