Planned

I can't seem to find FTP file name in fields data to map into NetSuite

How can I get the FTP file name in fields mapping data to NetSuite?

0

Comments

2 comments
Date Votes
  • Thanks, HARISH BAKKA. We'll add your vote to the feature enhancement request. 

    As explained in this post, the file name is available within the flow when the FTP file is downloaded

    Accessing the file name when its records are parsed is slated for a future release. 

    0
  • Hi Harish, 

    You can now get the file name by including the following script as pre-save page hook after the export step where FTP files are parsed. 

    function preSavePage (options) {

      for (let i = 0; i < options.data.length; i++) {

      options.data[i].fileName = options.files[i].fileMeta.fileName

    }

      // sample code that simply passes on what has been exported

      return {

        data: options.data,

        errors: options.errors,

        abort: false,

        newErrorsAndRetryData: []

      }

    }

    The output of above script can be as following (for illustration):

    {
    "data": [
    {
    "a": "Issue with file import",
    "b": "Need to have file name in description",
    "fileName": "sampleFileName"
    }
    ],
    "errors": [],
    "abort": false,
    "newErrorsAndRetryData": []
    }

    As a result, "fileName" will be available as part of mapping fields in Import step. (Below image illustrates mapping fields).

    The documentation for this feature was made available with the September 2001 quarterly release. 

    Please note that above script illustrates the use case and based on user's requirements, it can be modified. 

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post