Skip to main content

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

Planned

Comments

2 comments

  • Stephen Brandt Documentation Manager Community moderator
    Engaged
    Great Answer
    Top Contributor
    Celigo University Level 3: Master

    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
  • Srikanth Sreerama Senior Product Manager

    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.