In this tutorial we will setup 2 data entry forms with ConfiForms on 2 different pages, where one form will be just a proxy, and the data (including attachments) will be passed to another form. This is done using ConfiForms IFTTT macro with action to "Create ConfiForms Entry"
The data is passed to another form (and deleted from original) only when:
we set a field "Backup?" to true
See form configuration below for fields and types
If you are new to ConfiForms, please take a few minutes to read the Basic concepts Guide, or go through the video tutorial on that page.
As usual, let's start with form configuration (we will have 2 forms on different pages. Different pages is important here to demonstrate how the attachment/file type get's transferred)
So, a form with 4 fields
another text field
file type field
checkbox type field (this will be the condition to backup or not the contents)
Let's start with important bits about IFTTT setups, which will help us to implement this solution
For this 1st main form we will have 4 IFTTT handlers
2 for each event, and we will track record creation and record updates. and will fire the IFTTT action only when "Backup?" checkbox field is checked
See first 2 IFTTT integration rules, they are identical but are binded to different events, their fire when condition
is met, and they create a new record in our second form and, very important bit, they also say that field "f" should be included into action. Field "f" on our form is a file field type and this bit tells IFTTT action to transfer the File to a new place
Here is how the setup for those both IFTTT handlers looks like (they differ only in the event type they are binded to)
So, we fire this event only when "backup:true", meaning that checkbox to backup the record is set to "checked" and we copy values from original entry to the new one
And include the ConfiForms Field macro which references a file (in our case field type is called "f")
inside the IFTTT macro body
Last 2 IFTTT Integration Rules macros deal with cleanup in the original form (also binded to 2 events: create and modify).
When the same condition is met the cleanup routine is executed
So, the original record in original form get's deleted by given filter when "backup:true" condition is met
For IFTTT macro configurations which work with creating or deleting records in the form one very important configuration parameter is left unset
It is the form name and form's location (page)
So, scroll down for each IFTTT macro defined, and for the ones which copy the data the "Reference form and location" will be the backup form and it's location (pageId)
For the IFTTTs which clean up the data in original form you will need to reference this form
Where do you see the pageId?
The most easiest way is to go to the page edit mode and see the "pageId" parameter value in your browser bar
And the solution is ready!
First form takes inputs from a user, stores it inside it's own storage and when a backup is requested then the data is copied to another form (including files!) and deleted from original place