You are viewing limited content. For full access, please sign in.

Question

Question

Clear Attachments on a rerouted Form

asked on March 30, 2016

Good afternoon,

We have a Form where users upload attachments.  Before they submit, they have the ability to check a box that asks them if they want to upload documents for another person.

If they pick yes, the same form is provided to them again.  If they pick no, the process ends.  Very easy and everything works great logically with the repeats and such.

However if they mark Yes, and it returns them to the same Form, the attachments are still there.  Note that we are running a simple Workflow on submit if the Yes is checked to clear the some pieces of information.  Basically just the name on the Form (otherwise when it comes back, the same name would be there)

This is just done via a retrieve and set business variables. 

 

We are setting the radial button "add another dependent" to be nothing and we are setting the "dependent name" to be nothing.

So when the person gets the form those things are clear.  However in the retrieve business process variables we can select the attachment variables, but we cannot set the attachment variables in the set business process variables. 

Anyone know a way to clear the attachments on a Form if that same Form goes back to the user?

 

Thanks,

Chris

 

2 0

Replies

replied on April 8, 2016

Updating my post with the solution we eventually made.  Below is the code that is running on the Form in case anyone else runs into our situation.

$(document).ready(function () { $('table[class$="files"] tr').remove(); });

This code will allow you to upload attachments to a Form like normal.  Then when the Form submits, and that same Form comes back to the user to upload more, the previous attachments are removed.

We have tested it multiple times and seems to do the job.

 

 

4 0
replied on March 30, 2016

At this time, there's no way for Workflow to delete form attachments. Do these forms have to be part of the same process instance?

0 0
replied on March 31, 2016 Show version history

Yes, I believe they do have to be part of the same instance I believe.  Let me explain our scenario and maybe you have a better way to do it.

Basically we are doing a Veteran benefit application process.  We are currently on the step in the middle of the process where we have a big form where the users will upload all necessary documents.  So for the Veteran (even if they are not applying) they will need to upload things like drivers license, service record, divorce papers (if divorced), separation papers (if separated) and so forth.  All of this ties back to a veteran ID and when the attachments drop to Laserfiche, we name them Type - VetID.  We then use Workflow to perform lookups/file/etc.

The issue we ran into was for all the Dependents.  Since a Veteran can have multiple dependents we built a Collection that has the dependent information (name, depended ID, relationship, etc).  Then we have Upload Documents areas for each thing required (birth certificate if child, adoption papers if adoped child, etc).

When we submit these attachments, we name them Type - Dependent ID.  Workflow then uses the ID to file/lookup/etc.  But when submitting a collection that has multiple entries, the documents get put to Laserfiche using all of the ID in each of the names. 

So if I submit three dependents, each with a birth certificate, it comes to Laserfiche as:

Birth - 12345; 23456; 34567

Birth - 12345; 23456; 34567 (2)

Birth - 12345; 23456; 34567 (3)

We initially were just going to use Pattern matching to get the needed ID (the first is the initial, the second number in the (2) and the third in the (3).  However, we cannot guarantee that holds since dependents may not have all of the same type of upload.  A Spouse for example would would have Marriage 12345; 23456; 34567.  If the Spouse happens to be the second dependent in the collection we would need the 23456 number.

So we settled on having each Dependent being submitted separately.  First, they submit the Veteran info and the first Dependent.  Then this brings them to the Dependent form.  This form has all the info but only allows for one person to be entered.  At the bottom of the Form we have a box that asks if they want to submit another dependent.  If checked, it basically brings them right back to the same form where they submit another. 

A long explanation but that is why we are at the attachment clearing phase.  Unless there is a better idea for the collection piece then we don't have to worry.

Thanks Miruna. 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.