How to get a source filename and save it as a field value?


How to save the filename of the imported file in the field? 


It is possible to get a source filename and write a value to a field in the Custom activity. For example:

Context.Transaction.Documents[0].GetField("New Field").Value = Context.Transaction.Documents[0].SourceFiles[0].FileName;

The result:

Have more questions? Submit a request



  • Avatar

    Randy Woodward

    I created a new text field named "Orig_File". and then added a Custom activity with the following script:

    Context.Transaction.Documents[0].GetField("Orig_File").Value = Context.Transaction.Documents[0].SourceFiles[0].FileName;

    Running a "Test Skill" in Advanced Designer shows this error:
     JavaScript runtime error: Cannot read property '0' of undefined.
  • Avatar

    Tatiana Dyu

    Hi Randy, it seems that you are using the Script activity in the Advanced Designer. The Custom activity that is mentioned in the article relates to the Process Skill:

    Hope that helps.


Please sign in to leave a comment.