Working With Caldera Forms Form Drafts And Revisions

Choosing a Caldera Forms Form Revision To View

One of the new features for Caldera Forms is that you can revert to a previous version of a form. Every time you hit the save button in the Caldera Forms visual form builder a revision of the previous version of the form configuration is saved, just in case. This is useful if you want to see a field, processor or conditional used to be set up, or you want to go back to the way a form was configured before you made changes. Up to 15 revisions are saved per form.

This feature was added in Caldera Forms 1.5.3

Viewing A Form Revision

Choosing a Caldera Forms Form Revision To ViewOnce you have saved your form more than once, go to the Revisions tab. You will see a list of all saved revisions. You can select one and then click the  View Selected Revision button.

Once you click that button, the page will refresh and take show you the settings as they were when that revision was loaded. You will notice that the buttons at the top of the editor are now different.

Caldera Forms Editor When Viewing A Revision

When viewing a saved revision you have two new buttons:

  • Restore Form Revision  – This button will make the current revision you are viewing the primary form  that is used. The current primary form will become a revision.
  • Preview Form Revision – This button works like the normal Preview Form button except the current revision will be shown instead.

Showing A Form Revision Using The Caldera Forms Shortcode

The Caldera Forms shortcode can be used to show a form revision. Use the revision argument. Note: this only works for admin users. The primary reason for this shortcode argument is to facilitate revision previews.

Developer Notes For This Feature

Changing The Number Of Revisions That Are Saved

The maximum number of revisions saved per form can be changed using the caldera_forms_max_form_revisions filter. This filter can also be used to prevent saving revisions.

Database Changes To Make This Work

Previously to version 1.5.3, form configurations were stored in the options table. A new table cf_forms was added to store form configurations. For more information see the docs on the form configuration API.

REST API Endpoint

A new REST API endpoint, which is accessible only to a users who can use the form editor, was added. This endpoint returns the the ids of each revision, along with the revision edit link. For more information, see the documentation on the Caldera Forms REST API.