Is there a way to copy or save a data on a submitted form so a staff does not have to complete a new form? will just need to change the date every semester
Question
Question
Replies
Hello Alexa,
You could have the form feed the information that does not change (name, address, etc,) into a sql table (this would also involve Laserfiche Workflow). Then the next year when the review needs to take place again, the same form (as a blank) could be opened, and after entering the name of the student (or student ID for example), a lookup could be done that prefills the form with all the previous info, without the user having to retype anything. You could have the date autofill with the current date and have them click on submit. The completed form is saved to Laserfiche like the one the year before, but for the current year (which can be pulled from the document submittal date).
Just one idea.
Have fun with this!
Christine
The data will be saved until the process is complete for use in tasks like approvals and needs fixes from the initiator. If they are starting a new submission later on down the line, why not have a form that only requests the information that needs to be changed while keeping the master information in a template or table for reference.
Thanks for the response. Just to provide context.. Our counselors complete a new accommodations form for students every semester. The accommodations usually do not change but the semester/year has to be updated. So it will be different data for each student.
Also, I am new to Forms so I am not really sure what you mean about setting up template/table
For example on submission you can use a Save to Repository activity to create a PDF document in your repository which is a copy of the web form submitted. This document can have a template applied for storing data used to find the document and data that needs to be tracked related to the document. This template can contain a modifiable date field which can be updated at anytime and when updated anyone pulling up the document will see the currently set date.
The purpose of Forms is for capturing data, assigning tasks, and routing the data to the people who need to see it for their task. It can do this sequentially to fully automate just about any business processes.
Templates are designed for finding documents and/or tracking information that needs to be updated related to that document. In this case it seems you just need a template where they can go update the date. That template can be configured automatically at the end of your current forms process for new student accommodations.
@████████ solution would probably work best for what you are doing. We have a similar process as my school district and we have to record each update for the student if it applies over multiple years. Using a lookup rule from SQL is a great way to prepopulate the form with previously completed data. If you have a long form or have checkboxes and radio buttons in the form, you can use this JavaScript on the initial submission to collect all the values of the form from the first submission.
//The JSON data field const jsonFieldLKP = LFForm.findFieldsByFieldId(YourfieldIDforlookup)[0]; const jsonField = LFForm.findFieldsByFieldId(YourfieldIDforcollection)[0]; //CSS class to skip const skipThisCss = "skip"; //Exclude readonly and fields with the specified CssClass const fields = LFForm.findFields(f => f.settings.readOnly == false && f.componentType != "Page" && f.componentType != "CustomHTML" && f.componentType != "Section" && f.componentType != "Collection" && f.componentType != "Table"&& f.settings.cssClasses?.includes(skipThisCss) != true); console.log(fields.length); //Update JSON after field changes fields.forEach(f => { let fld = LFForm.findFieldsByFieldId(f.fieldId)[0]; LFForm.onFieldChange(() =>SaveFieldValuesToJson(), fld); }); //When SQL lookup is complete, update all fields from the JSON values LFForm.onLookupDone(function (lkp) { let json = LFForm.getFieldValues(jsonFieldLKP); if (json == "") { return; } //Skip if no value saved to SQL let fieldValues = JSON.parse(json); fieldValues.forEach(f => { let fld = LFForm.findFieldsByFieldId(f.id)[0]; LFForm.setFieldValues(fld, f.value); }); }, {lookupRuleId: Your lookup rule ID}); //Adjust the lookupRuleId accordingly function SaveFieldValuesToJson(){ //Array for all fields on form var savedFieldVals = []; //Record the ID and value for each matching field fields.forEach(fld => { let fieldId = fld.fieldId; let fieldVal = LFForm.getFieldValues({fieldId: fieldId}); let fieldType = fld.componentType; //Create object for saving field data let fldData = { id: fieldId, type: fieldType, value: fieldVal}; //Add to array savedFieldVals.push(fldData); }); //Create JSON from array of fields let json = JSON.stringify(savedFieldVals); //Update the value LFForm.setFieldValues(jsonField, json); }
You only need two multiline fields hidden in your form. One to collect the field values and one to pull the values with a lookup from SQL. You can store all the values to a single column in a SQL table and use a reference number such as the Instance ID for the counselor to enter in on the next update to pull in the previously saved data. This is in the Solution Marketplace if you want a sample form and setup instructions: Repopulate Form Data for External Users *This can be used for internal or external forms, the script just populates the fields with stored values from a previous instance.
Make sure to add css "skip" to the multiline fields.