When creating an app that allows end-users to submit new records you may find it necessary to add an approval process so that new records can be reviewed before they are published to the general public.  This article shows you how to set all new records to inactive in order for you to review and publish submissions through an internally facing DataPage.

approval-process

Steps to create an approval process:

1.  Add an approved checkbox to the base table

  • From the Caspio Bridge homepage screen, click on Tables which shows you the list of tables  residing in your Caspio bridge.
  • Select the table that holds all of your public facing records and open the Table Design view by clicking on Design.
  • In the first available row enter the fieldname “Active” and set the data type to Yes/No.
  • Click Save.
how_to_create_an_approval_process_for_new_submissions_1
All of your records will be marked inactive by default.  You may want to mark all of your current records as active either individually, or by downloading the current table to an Excel workbook, setting all of the values of the Active column to “TRUE” and then importing the data back into Caspio Bridge using the “Replace” option.

2.  Filter the published records so only approved records are visible

  • Select the Report DataPage that your public end-users use to view records. Click Edit.
  • Proceed to the Select Search Fields screen. Move the Active field created in step one to the right-hand column using the arrow buttons.
  • Select the Active field in the DataPage Elements panel and using the Form element dropdown menu, select Hidden. Check the “Yes” value next to On load assign.
  • Click Finish to save your changes.
how_to_create_an_approval_process_for_new_submissions_2
Now only records with the active checkbox checked will appear visible to your end users.  If you have not yet marked any records as active as explained in step one, all searches will return “no records found”. Next, you create a search and report to view and publish unpublished records. In order to view the records internally before they are published to the public, you need to create a second DataPage.

3.  Create a search and report to view and publish unpublished records

  • Select the public facing DataPage, click More and click Copy.
  • Rename the page to indicate it is for internal review of records. Click Save.
  • Click Edit to open the copied DataPage.
  • Proceed to the Configure Search Fields screen. Select the Active field in the DataPage elements panel and change the form element to Radio Buttons.
Now you can choose to view only active or inactive items or both when you search.
how_to_create_an_approval_process_for_new_submissions_3

4.  Change the details page to allow modifications of individual fields

  • Proceed to the Select Details Page Fields screen.
  • Move the Active field to the right-hand panel using the arrow button.
  • Because this DataPage will be internal, you can change the default Display Only setting to an editable form element. For example, using the Form element dropdown, change the form element to a check box.
  • Click Finish.
how_to_create_an_approval_process_for_new_submissions_4
Now when you use this DataPage you will be able to edit any mistakes in the fields as well as mark the individual record as active.
You can customize the settings of various elements  listed in the Element Type. Some of the options for the Layout section are explained here:
Setting Description
Padding Specifies the spacing between the border of a container and its contents.Format: top right bottom leftExample: 1px 1px 0px 4pxYou can enter only two values to specify vertical and horizontal padding, or one value to set equal padding on all four sides.Applies to: Text Fields, Text Areas, File Fields, Label Cells, Field Cells, Buttons Cells, Data Cells, HTML Block Cells, Header Cells, Record Action Column, Data Download Layout, Paging Layout, Heading1 (h1), Heading2 (h2), Heading3 (h3)
Margin Specifies the spacing between the border of a container and the parent container.Applies to: Outer Container in Results pages (the spacing between the table’s border and the browser window), Heading1 (h1), Heading2 (h2), Heading3 (h3), Paragraph (p)
Table Width Specifies the width of the table, either absolute (in px) or relative to the available horizontal space (in %) or the width of the current font’s ‘m’ character (in ems).Applies to: Outer Container in Results Pages, Paging Layout.
Cellspacing Applies to Outer Container in List/Grid Layout only and specifies the distance between the individual record cells.
Container Width Applies to Data Download Layout only. For Data Download, you specify the width of the visible container instead of the entire table width. This enables right alignment of the Data Download control on the page. To ensure correct alignment, the Same as Results Table checkbox must be checked to keep the width of the entire table same as the Results table.
Cell Width Specifies the width of the table, either absolute (in px) or relative to the available horizontal space (in %) or the width of the current font’s ‘m’ character (in ems).Applies to: Label Cells, Field Cells, Data Cells, Header Cells, Record Action Column
Alignment Specifies how contents are aligned in the cell, horizontally and vertically. Click the ellipsis (…) button to bring up the picker and click the desired alignment icon.Applies to: Confirmation Messages, Label Cells, Field Cells, Buttons Cells, Data Cells, HTML Block Cells, Header Cells, Record Action Column, Data Download Layout, Paging Layout
Text Alignment Specifies how text is aligned on the page or within a container. Click the ellipsis (…) button to bring up the picker and click the desired alignment icon.Applies to: Error Messages, Buttons
Wrap Text Check this to wrap any long text in the container.Applies to: Label Cells, Field Cells, Data Cells, HTML Block Cells, Header Cells, Record Action Column, Data Download Layout, Paging Layout
Line Width Specifies the spacing between adjacent lines of text (similar to Line Spacing in text editors where 100% would be Single and 200% would be Double).Applies to: Paragraph (p)