I'm adding photos using forms
the database is increasing too much
what can I do to remove these files (Photohs) from the database?
Question
Question
laserfiche databases increase size
Replies
I am not sure if i understand you correctly but you could use workflow to delete that's already in the repository or maybe create a retention schedule to keep database under certain limits.
if you are deleting whats being added by form, then maybe dont add them in the first place.
please provide more information regarding use case.
Are you looking for a way to prune/remove old submitted forms from the forms DB?
If you are using Forms 10.1, you can deleted the completed instance from instances list, this will remove all the data for this instance include the attachments. If you just want to delete the attachments but still keep the instance, you can run following queries on the database(replace x with the instance id you want to delete)
declare @bpInstanceId int=x if object_id('tempdb..#submissions') IS NOT NULL DROP TABLE #submissions if object_id('tempdb..#prev_submissions') IS NOT NULL DROP TABLE #prev_submissions -- submissions SELECT submission_id INTO #submissions FROM cf_submissions WHERE bp_instance_id=@bpInstanceId SELECT submission_id INTO #prev_submissions FROM cf_submissions WHERE prev_submission_id IN (SELECT * FROM #submissions) -- attachments delete a FROM cf_bp_attachment_data a LEFT JOIN cf_bp_data_attachment_mapping m ON a.attachment_id = m.attachment_id LEFT JOIN cf_bp_data d ON m.bp_data_id = d.bp_data_id WHERE d.submission_id IN (SELECT * FROM #submissions) OR d.submission_id IN (SELECT * FROM #prev_submissions)
Hi, Is this still applicable in Laserfiche Forms 11 or there are any schema changes in this regard?
Actually I have to delete attachments on form submission through workflow after saving them in repository. The same form is used for revision multiple times and I want to clear attachment field to reuse. Just wondering if this can be applicable in my case. Thanks
Forms 11 has settings on its configuration page for clearing out data for completed instances and their attachments.
Deleting data from the database while a process is still ongoing is not supported.
Hi Miruna, Yes I'm aware of that configuration page. But our case is to clear one upload field once the task is done so that it can be reused to upload document in the next steps in the form process before the completion. So scenario is to store the attachment from upload field in LF repository through workflow and clear it out for the next step in the forms process.
Can we use the same technique to clear or reset that upload field from last submission and make it available to use upload field again for the next step? I have done some test and it's working fine but I really don't know if there will be any impact on the form in doing so.