AnsweredAssumed Answered

Rename File Workflow

Question asked by joec on Sep 20, 2016



I have a workflow that runs on a Document Library that receives email.  The Library is configured so that attachments sent with the Email are saved in a newly created folder.  The folder is automatically named with the corresponding emails subject line.  So for example, if an email is sent with Subject line "ABC123" with a file attached that is named "File.xlsx", a new folder is created titled "ABC123" and the corresponding email message and File are saved within the newly created folder.


I would like to create a workflow that runs each time a new folder is created and renames ONLY the file attachment so that it matches the Email Subject.  For our business purposes, all file attachments included in these emails will only be of type ".xls?" (either .xlsm or .xlsx). 


So I would the workflow to do the following:

1) When new items are created and items located in the folder have the file property of ".xls?"    

      A) Save the file name extension in a variable (var_ext).  For example, if the file name is "File.xlsm" than var_ext would 

       equal ".xlsm".  Likewise, if the file name is "File.xlsx" I would the var_ext to equal ".xlsx".

2) Rename the file to "EmailSubject.var_ext"


I am able to:

1) Get hold of the EmailSubject value

2) Isolate files with the ".xls" extension included in their names.


I am unable to:

1) Get the file extension placed in the var_ext variable.   Don't know if this can be done or how to do it.

2) Rename the file - Nintex produces an error message regardless of whether I use Update Item or Set Field Value commands.


Not sure if this workflow is possible to create but thought it would be as SharePoint Designer can, so am assuming I am missing some knowledge.