1 Reply Latest reply on May 12, 2017 7:35 PM by npgdan

    Drag & Drop Importing a file

    npgdan

      I am interested in an easier way for my users to be able to Import a file. My thought was to do 1 of other 2 things: Created a global field that can store the file path of a file or utilize a container field stored locally.

       

      How can I make a Drop & Drop field in my layout that will just record the file path of the file. Then I can make a Variable '$FilePath ' for my import script step?

       

      or,

       

      Make a Container field that is exported to a set folder, that I can make a variable '$FilePath' for my import script step?

       

      The first is the easier and simplest way that I would prefer. The file will always be a .xsls file but ideally I'd like to set one up for .csv as well. This is need due to the file has a different name each time I download it from it source. Would like to just have user 'drag-n-drop' the file then all the work happens.

        • 1. Re: Drag & Drop Importing a file
          npgdan

          Ok, so I figured it out.

           

          I created a global container record. Made a script trigger on the field to perform script on modification.

           

          Then the script checks if the record is empty. Then exports container field to set folder in Document folder. Documents/SCtemp/ Folder. Name the File SCTemp.xslx then I set a variable to the path and file name. $$TempPath

           

          Import Script step using $$TempPath for Filepath And name.

           

          Then clear Global container field.

           

          Works like a charm. I used get(DocumentsPath) to set the path way to the Documents folder. I used Set Variable $$FilePath with calculation to add SCTemp folder and SCTemp.xlsx file name.