Rename Attached file before saving

  • 9 November 2014
  • 3 replies
  • 6 views

Badge +10

Hi All,

 

I have a SmartBox smartobject containing a document field.

I've mapped this to a file attachment control on my view.

I want the user to attach any file, but then rename the file to a standard convention either before or during the Create method of the smartobject.

 

I haven't been able to find a way to do this.

One way which could have worked was to use the "set a control's properties" action and drag a value into this name. However, the filename field is read-only and cannot be updated like this.

 

Because I'm using smartbox, there is no Rename document method like there is in SharePoint.

Is there another way I can try?

 

Thanks!

JohanL


3 replies

Badge +7

Hi Johan,

 

I wanted to let you know that unfortunately renaming a file prior to uploading is not possible in SmartForms. However, a feature request for this was logged earlier this year. The ability to rename attachments in SmartForms is planned to ship with 4.6.10 [K2SF Designtime Controls - File attachment control to have an ammend property name].

 

Still, somebody may have some kind of answer for you. Another customer had suggested using a hidden list view on the form and transferring/renaming the file to that list before uploading it to SharePoint. What I'm getting from reading his suggestion is that you could attempt to start a sub-process to rename each attachment, but I realize that may get messy. 

 

Sorry if that's not optimal, but best of luck!

Badge +10

Just wondering if this is possible, Instead of using the smartbox create method for when items are added to the attachment list. Maybe start a process for items that are in a added state. Pass the file to the process. Then in the processes itself manipulate the <filename> xml string that is the file. and then call that create method on the smartbox itself. Just an idea, I havent tried this myself. I think writing code would be the easiest solution.  

Badge +10

Hi,

 

Thanks this solution will also work.

I luckily had the requirement to upload these docs to SharePoint when the workflow ends so I could then call the Rename Document method to rename the file.

 

But yes, no other clean solution (no-code) while keeping it in SmartBox.

 

Regards,

JohanL

Reply