Home > Builder Elements > Repeater
In Brief: The opposite of the rest of FormBoss, this element lets users pull data from a data source.
Dependencies: A valid SQL Database and table(s) to pull results from.
Hints & Tricks:
With Formboss 3 you can build complete update forms. As creating these elements can be quite involved, it is recommended that you check out this video for learn more!
Feature/Database Driver Support
This table gives a quick outline of the supported operations for each database driver used by the Repeater.
| MySQL | MSSQL | PostgreSQL | ODBC - Generic | ODBC - MS Access | |
| SELECT Rows | X | X | X | X | X |
| UPDATE Rows | X | X | X | X | X |
| DELETE Rows | X | X | X | X | X |
| Pagination | X | X | X | ||
| Images / Binary Data | X | X | X |
Important Notice About Builder Pagination and Older Versions of MySQL
If using an older version of MySQL, generally around the first release of 5 (e.g. 5.0.xx), you may run into a situation
where a Builder form that uses pagination will fail with an error similar to:
Error 1064: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '?, ?' at line 1.
The reason this happens is some older MySQL extensions do not handle the dynamic LIMIT clause properly, which in turn means the pagination logic fails. The solution is to force the use of the MySQLi extension, the PDO extension (both set in the Data Source properties box), or to upgrade your MySQL installation to a newer version.
Options/Properties
Basic Attributes
id
The id attribute of the Repeater module must be unique across all pages and forms in your job. That means duplicate names are not allowed, and if trying to name the repeater node the same as any other in the same job, FormBoss will prompt you to create a different name.
Data Source
SQL Repeater
Dynamic Variables
You can use dynamic variables in your Repeater SQL code, for example, if you have a page (page0.php) which can create a query string of: ./page1.php?id=1
When a user clicks this link, they will be taken to page1.php, which would be another Builder Repeater page. This page must then query the Database to retrieve the proper information for that particular variable.
Thus, we would create our Repeater node as normal, but in the Repeater SQL text area, we would add our dynamic variable to the query. We would create an SQL query that plucks the value of the _GET variable out like so (old syntax):
SELECT * FROM cars WHERE id = " . $_GET['id'] ."
PHP Variables
To retrieve PHP variables declared in the PHP Top Code section you use ${variable_name}
_GET Variables
#{get_variable_name}
_POST Variables
*{post_variable_name}
$_SESSION Variables (Starting in Build 623)
^{session_variable_name}
F{form_field_name} (Starting in Build 701)
New to Build 701, we can now use form fields to drive Builder queries. One thing to watch however, is that the form field in question is still active, in that the form sequence has not been submitted to a confirmation page. If it has, it's important to remember that FormBoss automatically removes all session elements from that form sequence, and thus the element will not be available anymore.
Security Concerns
As with any SQL interaction, it is important that we consider the security implications of opening data up to the public. To help secure your data FormBoss runs a sanitize routine on all dynamic variables you set; this routine strips out any SQL code, as well as UNION and OR keywords.
This routine should prevent almost any attack, though it is important to make sure your data source is just as secure. Restrict access to tables, monitor access, and try to break into your own site.
As a general precaution, the Builder module is not meant to create login pages, or any other form type that gates sensitive information. It should only be used to access tables that you want the public to have full SELECT rights to.
You can always enable Error/Info Messages from the SQL Debug Mode select item to echo out the SQL statements being run against your data source.
All told, with the proper security measures in place this makes the Builder Repeater incredibly powerful, in that you can create entire logistical networks where one FormBoss Builder page talks and reacts to others!
Other Important Notes
Dynamic Variable Limitations
When using dynamic queries with token variables e.g.:
WHERE id = #{id}
Your calls to the Dynamic Variable Picker + Token Chooser will not show the results of this WHERE clause filter. This should be a non-issue, though if for some reason you have a query that returns an alias you'll need to supply hard-coded values until the form is ready for deployment.
Complex SQL Considerations
By default FormBoss attempts to rewrite your Repeater SQL queries to perform a count(*) query for various house-cleaning tasks. The limiting factor with this approach is that more complex queries such as the one below do not work with the default count(*) query rewrite, and hence, the query will fail as the rewritten SQL code is not valid. Thus, in the default mode your FormBoss Builder only supports queries in the form of:
[ SELECT ] [ fields | * ] [ FROM ] . . . [ { JOIN } WHERE ]
All is not lost however. As of build 625 their is a new option to overcome these limitations. Before we look at the solution however, let's try to understand the problem.
Let's use the following query as an example:
SELECT DISTINCT
U.user_id, U.db_email, D.counted
FROM
users U
LEFT OUTER JOIN
(SELECT
user_id, COUNT(user_id) AS counted
FROM
uploads
GROUP BY
user_id) D ON U.user_id = D.user_id
WHERE
U.user_id = 1
ORDER BY
U.user_id DESC;
Although this is a fairly complex query, the problems FormBoss will have with it are pretty simple: The DISTINCT Keyword would not be compatible with the default FormBoss Builder parsing engine, as noted above, FormBoss expects the query to be in the form of:
SELECT * FROM table
The second potential problem is when you add paging to a form FormBoss needs to append the relevant LIMIT and ORDER BY keywords to your query, which means the code above would not work, as we already have an ORDER BY clause. FormBoss will dutifully add another ORDER BY thereby breaking the query.
So how do we run such a query? As already stated the first limitation has been addressed in Build 625 with the inclusion of a simple Checkbox item called: No Count(*) Rebuild. Checking this box means FormBoss will not rebuild the query but rather leave it untouched.
The benefit of this simple change is drastic. Using some conditional code in the Builder page, FormBoss will now count how many rows are returned by the query itself, eliminating the rewriting issue. Thus, queries that contain DISTINCT in the front part of the query will work.
For more information, please see the No Count(*) Rebuild section below.
Of course that's great, but it still leaves the issue of our paging and extra ORDER BY CLAUSE.
The fix for this is simple:
Never include a ORDER BY or LIMIT clause in any query you intend to use with paging.
Of course this may still break some queries, though this is one of the limitations of using Builder with complex queries. At times them it may be beneficial to reconsider our approach to the problem, by, for example, rewriting to query to be less complex, or by using Views.
Using * JOINS With Tables That Have Duplicate Field Names
I'll admit this one is pretty obscure, and is only
relevant to users who chose to use the MySQLi extension.
The basic issue is that when you perform a JOIN using * to select fields, MySQL will take any duplicate field names and append such duplicates with a 1. For example:
Table 1.
id, make, model, year, image
Table 2.
id, image_data, image_name
SELECT
*
FROM
cars
INNER JOIN cars_images ON cars.id = cars_images.car_id
WHERE
cars.id = '2'
Will return this field list:
id, make, model, year, image, id1, image_data, image_name
The id1 is because both tables have a field called id. Unfortunately, this will break the MySQLi query code, which means your form will not work.
The solution then is to not program like that! Any database expert will tell you that star (*) queries are evil for anything other than testing and quick prototyping.
Thus, our fix will be to not use a star, instead specifying each field as we go. Alternatively, we can also simply not use duplicate field names, for example, we can change the Table 2 id field to image_id.
MySQL DATE_FORMAT Issue
FormBoss takes any parameters we pass in the Repeater SQL box and runs them through sprintf(). This is a necessary step, as it ensures our queries are safe from SQL Injection.
However, a potential downside is any percent signs we provide as parameters to MySQL functions, as is the case for DATE_FORMAT, will cause a sprintf() error when we run the form.
The solution is to simply escape any existing % signs in your code, done by adding a % in front of the existing one. For example:
SELECT
DATE_FORMAT(ts,'%m/%d/%Y') AS fdate
FROM
fb_demo
WHERE id = #{id}
Would need to be re-written as:
SELECT
DATE_FORMAT(ts,'%%m/%%d/%%Y') AS fdate
FROM
fb_demo
WHERE id = #{id}
Using Hyphenated Table Names
If your SQL statement includes
a hyphenated tablename you'll need to be sure to wrap the table name with `` marks. If we do not the Repeater query will fail.
Token Chooser
This is an incredibly important part of the Repeater module. When you click this link, the SQL query you enter into the Repeater SQL text area is run against the FormBoss data source, or if you have supplied a valid connection via the individual Data Source boxes or though a DB Connector File, though the specified external data source.
FormBoss then creates a list of default and dynamic variables for your query. The default list come from the functions FormBoss provides by default for interactions such as Paging and Total Results displays. The dynamic variables come directly from your SELECT field list. For example, if you input the following into the Repeater SQL text area:
SELECT name, birth_date FROM person;
The Dynamic variable list will display field variables in the following format:
variable name -> sort -> sort direction -> image call -> function place holder -> sql type
For example, the sample SELECT call above would produce (shortened list):
name -> Sort -> Sort Direction -> Flat Image -> Function -> VAR_STRING
birth_date -> Sort -> Sort Direction -> Flat Image -> Function -> VAR_STRING
The items in blue are links. Each link is a token that performs a different task when the form is built and run. When you click a link, it sends the token text to the Repeaters text area box, which can be in simple or WYSIWYG mode.
Thus, the process of building a dynamically generated page is to create an SQL statement; open the Dynamic Variable Picker window to check your statement; then create a layout in the text area box which you plug the tokens in to by clicking their links.
Learning which links do what is really the key to using the Repeater. The best way to learn is to watch the Basic Repeater Video in the Help Videos section.
Use Paging/Sorting
Clicking this box will instruct FormBoss to create paging and sorting code for your result sets. Checking this box is a must if you have paging or sorting tokens in your template.
Initial Page Size
This is how many results you want to display per page by default. If used in a searchable form where the Display All Rows By Default (Search Only) is checked, this will be how many rows are displayed when the search form is first visited.
Sort Order
This is the default sorting order of your results.
Sort Criteria
Initially blank, if you activate paging, you will need to set a value in this box or an error will be triggered when you try to run your page. This simply needs to be the field name of one of your result set items. For example, name, or birth_date from the example above.
New to Build 671, we can now populate this field with a comma delimited list of columns to sort by. This is of course handy for forms where we need to sort by more than one column. Please note however, that if your form can be sorted (by adding the sort tokens), unless you specify the same multiple columns in your sort token, the initial sorting will be lost. Please see the sort token documentation below for more detailed information on making sure your tokens are set up properly.
It's also important that our column names do not have spaces. If they do, the Builder form may fail, or at minimum, the sorting logic will not work.
Relaxed Search
If you are creating a searchable form, checking this box means when the form is first visited all rows will be displayed to the user. When used in conjunction with the Enable Paging and Initial Page Size values you can create forms that act like automotive site search forms, in that the user need not fill in all fields to return search results.
Conversely, you may want to create a form that starts off blank; the only rows returned to the user should be ones that have been specifically searched for. If that is the case, leave this box unchecked. When a user first loads the form, the search form will be empty. A classic example of this type of form would be an employee lookup form, where the user is required to input valid search data to return any results.
A few points of note: First, the term Relaxed Search is used to imply that the standard for returning information in this mode is not as tight as if this mode was enabled. This has consequences for multi-field search forms, in that the Join condition (see below under The Repeater Token Set > Dynamic Field Variables > Search > join) is ignored if only 1 field has an entered value. For example, a car search form might have Make, Model, and Year. The joins could be:
WHERE make= :make AND model= :model AND year= :year
Relaxed Search means that even though our model field is joined with an AND, the user could search for Corvette and still return results. In many instances this is the preferred behavior, though not in all. If you want to make sure your logical joins are respected, you need to make sure this checkbox is unchecked.
Second, By default all rows will be returned unless you Enable Paging for the form. For small data sets returning all rows is fine, but larger ones it is not. If your form has more than 50 rows you should probably use paging. Please keep in mind if we enable paging we must also set a value for Sort Criteria. By default you should simply make this the primary key of the table being queried.
No Count(*) Rebuild
New to build 625, this checkbox item
is important if you plan on using complex queries that contain qualifiers such as DISTINCT in the SELECT cause.
To help you understand why this option is important, it helps to know a little background. When you run a Repeater SQL query, FormBoss, by default, will attempt to rewrite the query with a count(*) clause to retrieve the total row count*. This row count is used for several operations including paging and the #{*T_total_results} token. While this automatic rewrite allows you to create complex paging elements with almost no effort, the downside to this operation is the SQL query has to fit a pretty rigid mold. As already stated, no extra keywords are allowed in the SELECT statement, and so on.
*In fact, you can see exactly how FormBoss is rewriting your queries by enabling the SQL Debug Mode (see below). Viewing this output shows you exactly how the *default* rewrite affects your SQL code.
The solution to this issue is the No Count(*) Rebuild checkbox. By checking this box you tell FormBoss NOT to rewrite your query but instead run it untouched and retrieve the row count by issuing a count($result->fetchAll()) operation.
The potential downside to this method is if your result set is large you may run into PHP memory issues. However, this should not be an issue for the vast majority of users.
No Results Message
This is the text that appears
when a search or SQL query does not return any results. If you are creating a search form, the text should be along the lines of "Please Refine Your Search To Return More Results". If you are creating a form that does not Display All Rows By Default, the message should be of an explanatory nature, letting your users know how to use the form to return results.
Alternate Rows
Check this box to apply alternating row colors to your fields. This color is controlled via the Alternate Color attribute.
In terms of template implementation, alternating row colors are only applied to tr elements that have a class="alt" definition. That is, when we export the form FormBoss looks for and applies PHP code to any block that has this option checked, as well as a class definition of alt.
By default all standard FormBoss templates already have this class definition, so no extra work is needed. However, if we create our own templates, or we modify an existing template and accidentally erase this class attribute, alternating row colors will not be applied.
Alternate Color
This is the background color of the rows if Alternate Rows is checked.
Paging Link
This is the color of the text that
is not reversed but is still a link. For example, the BACK and NEXT links, along with the page numbers when not being hovered over.
Paging Background
This is the color of the solid box each active page and hover uses. It is best to make this the same color as the Paging Link.
Paging Outline
This is the color of the active page's boxed outline.
Paging Non-Link
This is the color off text that is not active. For example, the BACK text when you're on page 1, and hence, cannot go BACK one page.
Paging Active
This is the color of the current links page number, and the hover color of the text that uses a solid Paging Background. For example, if you're on page 1, the 1 is this color. Similarly, if you hover over the NEXT link, the NEXT text will turn this color. Best if this color is a strong opposite of the Paging Background Color, such as #fff (white)
Handling and Displaying Images
There are several ways to display images in Repeater items. The biggest consideration is weather our images are flat files or stored in the database.
Flat File Images
If they are flat files (images stored on the harddrive just like other standard files), the same technique desribed in the Flat File module documention is a good solution:
Assuming a file upload item Name/Value of file_1, The most common technique for this would be to set your Flat File Directory to a folder one level up from the form with:
../upload_images
Then in the SQL+ Module, set the file column to the name of the file with:
INSERT INTO entries (file1_name) VALUES (?)
And this for variable value:
file_1_name
Now in your Builder Repeater, create an image item, and set the fully qualified link to the file1_name database field with this as the images path:
http://domain.com/formboss/output/forms/standings/#{file1_name}
Thus, you would now have images being uploaded to your server file system, a record of the file name in the database, and in the Builder Repeater token, a link between those two items in the form of the image link which looks in the folder of images for the image name saved in the file1_name database column.
Database Images
Grabbing images from a database is similar to flat files in how you construct the elements in FormBoss,
but differs fundamentally from how it actually works behind the scenes.
Although this technique can be preferable to flat files for security purposes, it is a bit more involved. Thus, if you are a beginner, it may be best to stick with the flat file method, or at least give that a shot first.
To grab database images, you will need a table that accepts images and a PHP function that returns a header() call with the images appropriate mime information.
Luckily, starting with FormBoss Build 623, we now include a helper file for this task in the /lib directory of your job called get_image.php, though in order to use this table you need to store your images in the pre-installed fb_images table.
The basic workflow is to use two tables at minimum, one for the text info, one for the image data. We tie the two tables together with an index created using the Set lastInsertId() = $ret_val feature of the first SQL+ item (the text INSERT), this lastInsertID is then INSERT'ed as a standard field element to the entry_id field of the fb_images table. Hence, our id of the text field becomes the entry_id of the fb_images table, we now have a common connection between the two tables for that entry.
So long as we have proper image data in the fb_images table, to get the image data out we query the get_image.php helper file with this value, which is placed in the Image URL field of the WYSIWYG editor:
lib/get_image.php?id=#{id}
In other words, we pass an id parameter of the current rows id field to the get_image.php function. Becuase the current rows id should match the entry_id of the fb_images table, the get_image.php function will go ahead and grab the image and display it.
If this all sounds a bit confusing, please check out this job for a complete demo:
formboss/goodies/Sample Jobs/Builder and Builder 2/database_images.xml
Important Note On get_image.php, get_single_image.php, and get_file.php*
For security and logistical reasons, get_image.php, get_single_image.php, and get_file.php in versions 694 and lower only used the database information stored in the jobs config.php file. This meant if you moved a job to a clients server, you also had to update the config.php file for that job that match the clients database.
As of Build 695 however, this is no longer true, as the process by which we set the connection information of the get_image, get_file, and get_single_image files has been improved.
Specifically, FormBoss will now automatically update each of these files with the same connection data we set in the Data Source properties box of the main Repeater element.
In the old way we were forced to always use the connection details defined in the jobs config.php file. This meant if we defined a different database for images, we needed to manually update the helper files.
The new way means that any connection details we define in the Data Source for the Repeater element box are the default values used for all image and file grabbing operations.
To 'catch' is we now have a query string parameter we can activate to revert to the old method if needed:
By default, FormBoss will check for a GET variable of:
$_GET['connector']
If this is set with any value other than:
default
FormBoss will not use the inline connection data which matches the Repeater element, but will instead use the values set in config.php.
READER NOTE: The next 11 fields only apply to builds higher than 640.
Allow User Updates
New to Build 640, checking this box will enable users to update records.
As creating Builder Update Repeater Elements can be quite involved, it is recommended that you check out this video for learn more!
However, for a brief look at the Builder Repeater Update process, please check out the yellow call out box directly below.
UNDERSTANDING THE UPDATE/TEMPLATE PROCESS
The first step to creating any update form is to apply an 'Update' template to your Repeater WYSIWYG work area.
With that done you create a SQL query in the Repeater SQL text box which will allow you to create a Token Chooser, this token chooser then lets you place the various tokens which will be transformed by FormBoss when you save the form into the various update items such as buttons, radio groups, and so on.
It is important to remember that you have lots of control over this process, most importantly concerning the templates.
UNDERSTANDING TEMPLATES AND COMMENT TOKENS
The Update templates are just standard HTML, but specific to FormBoss, include four or more HTML Comment tokens which are replaced during form creation with HTML or PHP code. For the UPDATE operations, these comment tokens are:
<!-- UPDATE START -->
<!-- UPDATE END -->
Along with:
<!-- REPEAT START -->
<!-- REPEAT END -->
In other words, when you look at the HTML source of an update template you will find those four comment token blocks sitting within a <tr> block surrounding all form update elements (the tokens you adding using the token chooser). When you build your form, these comment tokens are automatically replaced by FormBoss with the proper UPDATE and REPEAT code, which in the case of UPDATE comment tokens is a HTML <form> tag, and in the case of the REPEAT comments, SQL repeater code.
It is imperative that these tokens remain in your HTML code! If you remove them, FormBoss will not be able to process your form correctly. If ever in doubt, you can always create a new Repeater module and add a update template to it to see the default set of tokens.
As they are within the <tr> block, the <form> html code will also sit within a the <tr> row, which means when the Builder Template parsing engine creates and runs the form, every row of data sits within its own form.
You will also notice that just outside of the <tr> block sits another set of comment tokens*:
<!-- REPEAT START -->
<!-- REPEAT END -->
These comment tokens are what tell FormBoss to insert the SQL iteration logic which will create the "rows" of results on an exported form. Again, this means these comment tokens are replaced with PHP iteration code when you save the form, and hence never "show up" in a final form. They only exist to allow for easier to manage template code.
*NOTE: Prior to Build 640 the two repeat comment comments were:
<!-- #rpt -->
<!-- ##rpt -->
They have been changed to more closely align with the syntax of the UPDATE.
Knowing about these comment tokens is important because you are by no means limited to using the templates supplied with FormBoss. You can create your own in any program you like, so long as you remember to include the proper comment tokens in the proper place.
That said, the various comment tokens are added for you in any template with the corresponding feature in its name. For example, a Template called 'Repeater - 3 Column + Update' will already include the proper repeater and update comment tokens.
Please be aware though, that unless your template has the correct comment tokens the operation will not work. This is a security feature! FormBoss gives you total control over how and what features are available for any form.
INCLUDING A PK FIELD
To help ensure you're not going to add an update or delete from by accident, FormBoss requires that each update or delete operation consists of at least 1 Primary Key (PK) field. A PK field is simply the database field which will act as the index for any SQL code you write.While we typically see the PK referenced in the WHERE clause, it can be used anywhere we need.
The key is that not only should we include the PK in our SQL WHERE clause, we need to physically add a PK token to our form for any UPDATE or DELETE operation to work. As the PK token is actually a hidden field it is not necessary to worry about styling it--just be sure to include it!
Allow File Uploads
By checking this box you will allow your users to upload files to your database.
Starting with Build 642.r4 and Build 646, you can now collect meta information on your file upload and pass it to your SQL statement. You have three fields to choose from:
MIME - The MIME Type of the file. Shortcut: mime
Size - The size in Bytes of the file. Shortcut: size
Original File Name - Shortcut: name
To pass these values to your SQL statement add an underscore and the shortcut name to the file item name. For example, if we had a file upload item named image_data we would use this for the SQL Statement:
UPDATE fb_images SET image_data = ?, image_name = ? WHERE entry_id = ?
And this for the Parameters List:
image_data, image_data_name, id
Again, notice how we use image_data, then add an underscore plus the shortcut name, in this case, name, to the variable. This is almost identical to the process we use for the SQL+ Module.
One very important note on mixing and matching file/image uploads with non-file upload fields
FormBoss was designed to only update a file field if a user has actually selected a file to load for that record. This means so long as the user doesn't select a new file to upload, the file row will never be touched upon submission. This is so because technically speaking, FormBoss automatically terminates any file update SQL statement that would place null data into the existing file slot. In short, we are not allowed to upload 'nothing' into an existing slot.
This is fine for forms that only have file data, but most of our forms will mix and match file and non-file data.
To address these types of forms, we must break the Repeater Update SQL statement into two logical components: one SQL statement for each file update, and one SQL statement for everything else.
How? Simple: replace logical components with multiple SQL statements, then take advantage of FormBoss' ability to handle multiple SQL statements in one block.
So for example, if we had a builder form that had image and text update in one block, we would rewrite this single SQL UPDATE statement:
UPDATE fb_images SET image_caption = ?, image_description = ?, image_data = ? WHERE image_id = ?;
as this:
UPDATE fb_images SET image_caption = ?, image_description = ? WHERE image_id = ?;
UPDATE fb_images SET image_data = ? WHERE image_id = ?
Likewise, we would also make sure to update the Repeater Update Variable List from this:
image_caption, image_description, image_data, image_id;
To instead be:
image_caption, image_description, image_id;
image_data, image_id
It should be noted that from an architectural standpoint it is highly recommended that your file data table only hold the base file data and the name, mime, and size properties. Any other meta information such as upload date, file meta data (such as description, caption, etc) and security settings should be placed into a separate table joined by a foreign key. Doing so will ensure that your database has the maximum portability and redundancy. A good example of this is the fb_demo and fb_images tables.
Repeater Update SQL
This is the meat and potato's of the UPDATE feature, in that regardless of what token items you supply to a form template, the code you type in this box will decide what and how your database is updated.
The format is standard UPDATE syntax, as in:
UPDATE fb_demo SET name = ?, email = ? WHERE id = ?
FormBoss will take any fields supplied in the template, match them with the repeater update variables, and post the change to your database.
Of course most importantly we need to supply a proper set of variables including the value(s) passed to the WHERE clause!
Multiple SQL Statements In One Box
New to Build 641, you can include multiple SQL statements in one block. The syntax for this is the same as what you would type for normal SQL, only you must separate each SQL statement with a semicolon. Please note you must also separate the variables with a semicolon that matches the corresponding SQL. For example, this SQL:
UPDATE cars SET year = ?, make = ? WHERE id = ?; UPDATE fb_images SET image_data = ? WHERE entry_id = ?
Would work with this variable list:
year, make, id; db_image, id
Notice how year, make, id; match the first SQL statement of:
UPDATE cars SET year = ?, make = ? WHERE id = ?;
And how the same is true of the second statement.
Where Multiple Statement are Required
Multiple statements are required for UPDATE operations where we want to update text and file data, and it's a possibility that the user could leave the file element untouched. This is because for security, FormBoss short circuits any file upload statement where the file data is empty.
Repeater Update Variable List
Just as important as the Update SQL are the variables you pass to it. In this box we define which template tokens are used as the values for the fields defined in the SQL statement.
It must be noted that you can also include PHP variables in this area, the format is:
variable_name
That is, unlike most other FormBoss fields, you do not need to add a dollar sign or any token characters such as the braces or pound sign.
A common way to do this then is to create a variable such as a DATETIME in the PHP Top Code section:
<?php
session_start();
// Your Code Below...
$datetime = date('Y-m-d H:i:s', time());
?>
Then include the variable in the Variable list as just: datetime
As noted above, in Build 641 we can now use multiple SQL statement in one box. If we do so, we must be sure to separate each statements parameters with a semicolon.
Auto-Redirect After Update?
If this box is checked FormBoss will automatically handle the
logic needed to redirect your users to the same page they were just on, that is, the update repeater page. However, as this is usually handled anyway, it is redundant. However, if you want to create your own custom redirect, we would need to uncheck this box, otherwise FormBoss will ignore your custom redirect call created in the PHP Code To Run After Update box.
PHP Code To Run After Update
This handy box allows us to run code after our UPDATE statement. Common examples would be logging code, access checks, redirects, and so on. Please note you do not need to supply PHP open and close tags.
Using this area let's us create all sorts of cool logic. For example, let's say we wanted to redirect to a new page after the update, but we also wanted to use the id of the last updated item to create a query string. To do so we would create a PHP header() call like so:
header("Location: http://www.formboss.net/index.php?id={$_POST['id']}");
exit;
The most important part of this example is that so long as we include the proper name of the POST field our UPDATE form contains, we can use the live value in our header() call.
Allow User To Delete Records
If checked FormBoss will allow a user to delete records.
Confirm Record Delete?
If checked, this box will create a JavaScript based prompt before any record is removed. Be careful with this setting, as generally speaking we always want to have this enabled!
Repeater Delete SQL
Just like the Repeater Update SQL box, this code determined what and how your database is updated. Normal DELETE syntax is used as in:
DELETE FROM fb_demo WHERE id = ?
Of course of paramount concern is the WHERE clause.
Multiple SQL Statements In One Box
New to Build 641, you can include multiple SQL statements in one block. The syntax for this is the same as what you would type for normal SQL, only you must separate each SQL statement with a semicolon. Please note you must also separate the variables with a semicolon that matches the corresponding SQL. For example, this SQL:
DELETE FROM cars WHERE id = ?; DELETE FROM fb_images WHERE entry_id = ?
Would work with this variable list:
id; id
As a general rule though, although you can use multiple SQL statements in FormBoss for DELETE queries, it may be worth looking into Foreign Keys for handling cascading deletes to implement a more robust solution.
Repeater Delete Variable List
This is the list of variables which will be used to determine which rows are removed. Again, chief among these variables is the value passed to the WHERE clause, which needs to be a proper PK field. By proper we mean when we remove a record from a database we need to be very careful how this is done.
The best and most common way to handle this is to use a Primary Key (PK) on the table in question, then use this unique PK value to tell the WHERE clause exactly which rows gets removed.
It must be noted that you can also include PHP variables in this area, the format is:
variable_name
That is, unlike most other FormBoss fields, you do not need to add a dollar sign or any token characters such as the braces or pound sign.
A common way to do this then is to create a variable such as a DATETIME in the PHP Top Code section:
<?php
session_start();
// Your Code Below...
$datetime = date('Y-m-d H:i:s', time());
?>
Then include the variable in the Variable list as just: datetime
As noted above, in Build 641 we can now use multiple SQL statement in one box. If we do so, we must be sure to separate each statements parameters with a semicolon.
PHP Code To Run After Delete
This handy box allows us to run code after our DELETE statement. Common examples would be logging code, access checks, redirects (to the main result listing page), and so on. Please note you do not need to supply PHP open and close tags.
SQL Debug Mode
Choose from No Debug or Error Messages. No Debug is what should always be used for production forms, Error Messages when developing.
The FormBoss Builder Repeater works by transforming tokens into code when you run your form. Tokens allow you to create complex form logic with the minimum amount of coding, all while providing a powerful interface for creating more complex logic should you need it.
Tokens come in many forms, from field items to search buttons. Token are divided into two main categories, Built-In Variables and Dynamic Field Variables. Built-In Variables are those tokens which are constant across all forms you build. Dynamic Field Variables are custom created for each SQL query you place into the Repeater SQL box.
In this list we shall list out the tokens available to you, and how to use each.
IMPORTANT NOTE: Prior to Build 640 each token must be separated by a space.
| Built-In Variables | |
|---|---|
| Token Name | Token Description |
| *P_pager|BACK,NEXT| | Creates a pager element in your form. This pager will allow users to scroll back and forth through a result set, this result set being the result of a search or a simple one-off query. As of Build 701 we can now set the BACK and NEXT text used in the final display. |
| *R_results_per_page|| | Creates a select menu which lets users select how many results to display per page. This requires that you have checked the Enable Paging box, but does not require the *P_pager. For example, a token of: #{*R_results_per_page|1,2,All|} Will make FormBoss produce a select set of: 1 > 2 > All Where all is a hard-coded value of 50000. This is very handy for times when we want to export all records from a database, and the default 50 is not enough to show all rows. As a further example, a token of: #{*R_results_per_page|5,10,15,20|} Will make FormBoss simply display a select item with the values of: 5 > 10 > 15 > 20 Thus, the rule is any numeric value used as is, text based values are always treated as 50000. If you want to use the standard set, simply leave the options block blank, as is the default: #{*R_results_per_page||} |
| *T_total_results | Displays the total number of results your query has produced as a simple text field. This token is always available to you weather you enabled paging or not. If you are using this is a search form, this number will reflect the total number of results of the search query. |
| *O_sort_order | Creates a drop-down manu which lets users select the sort order of the form. Requires the Enable Paging checkbox to be checked, and that you have provided a value for the Sort Criteria box. |
| *U_submit_button|,Search| | Creates a submit button. Only used for forms where you allow searching. For advanced users, this button simply calls a $_SERVER['PHP_SELF'] reference within a form tag. As of Build 699 this field takes two parameters. The first parameter is by default blank, and is the path to the image we want to use in place of a standard HTML submit button element. If no value is set a standard button is used. New to Build 699, the second parameter has a default value of 'Search', and as you can see, is the text located after the comma. This field can be changed as needed. It's important to note that the parameters must remain comma delimited in order for this field to work. That is, the first parameter can be blank, but if we want to use custom text for the submit button, we must still have the comma in between the pipes. |
| *N_update_button|,Update| | Creates an update button for use with templates that update data. This field, as of Build 699, takes two parameters. The first paramter is by default blank, and is the path to the image we want to use in place of a standard HTML submit button element. If you place a path to an image file in between the two vertical pipes (|), this will tell FormBoss to use that image file in place of a standard submit button. New to build 699, we can now specify the text to use for the actual search button. By default this is 'Update', but can be changed as needed. |
| *B_delete_button|redir,,Delete Record| | Creates a delete button for use with forms that allow users to delete form data.
As of Build 699 this button has three parameters, which when using the default values in english means: Do not redirect, do not use a custom image, and set the text of the delete button to 'Delete Record' If you change these values however, the first parameter you specify will be the page you're redirected to after the delete process is complete. You can also specify a query string in this field which means you could provide the receiving page a note of what action was taken, for example you could use this: #{*B_delete_button|index.php?delete=true,,Delete Record|} To redirect to the index page with a query string of delete=true. Why use this option? By default, after any delete operation you will automatically redirect back to the same page you're currently on. This works fine for pages where you have multiple rows that can be updated, but not as well if you have a specific detail page where just one row is shown. In those cases using the redirect variable is desirable. Finally, you can always use the PHP Code To Run After Delete to issue any redirect code you need, as that code always runs before the redirect specified in this token. The benefit of this approach is it keeps your template code a bit cleaner. The second parameter is used to specify a path to a custom image you want to use as the button graphic. The third parameter is the text we use for the delete button, as well as the text we show to the user if Confirm Record Delete? is checked (which by default always is). Thus, generally speaking the default is what we want, as FormBoss automatically adds a question mark to the JavaScript confirmation box. If we add a new value it needs to work in both forms--that is with and without a question mark. |
| *E_export_button| ,tab,export.xls,Export Data,| |
This field creates a button on the form that when clicked, exports the current dataset to a format of your choosing. Please note that in order to use the export button your form must have Use Paging/Sorting checked, along with a valid value for the Sort Criteria field. The field has a few main options. Like all other Builder tokens, the options are contained within the || block, with each individual option (parameter) being comma separated. The first field is new to Build 671, it allows us to set an image path to be used for the update button. Please note that by default it is left intentionally blank, as this means we just use a standard html button. tab = This is the format of the export. By default it is tab delimited, but we can also use csv. Please note that if you use csv, you will want to name your file with the .csv extension, as that way Excel will open it correctly. export.xls = The file name used when the save dialog box pops up. You can change this to anything you want, but it is generally most convenient to leave the extension as .xls, as that way the saved file is recognized by Excel in your users desktop environment. The only downside is upon opening the file, Excel will pop up a message saying the format is not correct. If this is a problem for your users, you may want to change the extension to .csv or .txt. Export Data Custom Export List User Defined Functions function_name()database_field So for example, we could have: #{*E_export_button|csv,export.csv,Export Data,upper()name,Active Ethernet,PON,SONET/SDH|} The first field, name, has a function that will run against it called upper(). We place this function in the PHP Top Code block as such:
<?php
function upper($v){
return strtoupper($v);
}
?>
When run, this code simply takes text input and makes it all upper case. |
| Dynamic Field Variables (as they appear from left to right in the FormBoss Variable List) | |
| Field Name | This is the most common field, when clicked it will place a token in your form in the format of #{field_name}. The behavior of this token is to simply place the value of this field as seen on the database in your form. |
| Sort | Used for creating a sort link in the header of a form. Assuming this field was for a database column named vehicle_year, the code created looks like: #{*S_Title|vehicle_year} We ignore the #{*S_, as that used internally by FormBoss to identify the type of token we are using. We are concerned however, with the Title|vehicle_year part. Title is what the text will be for the sort link. As stated above, this token is used to create sort links in the header of a form. That means we could replace Title with Vehicle Year if we were creating an automotive search form. When we build the form, you would see the word Vehicle Year as a link that when clicked on, would sort the entire form by that database field. Multiple Column Sort #{*S_ID|id} To make this token work for multiple columns, add a comma and the field name as in: #{*S_ID|id,name} Now when the form is run and we click the sort link, we will sort by id and name. Note! - Please do keep in mind that per SQL specifications, when we sort by the first parameter, only if the table has multiple instances of this first parameter will you see a difference due to sorting on the second parameter. So for example, if we have multiple instances of the same id would our sorting on name come into effect. |
| Sort Direction | This token is similar to Sort, only instead of creating a header element with text which sets which column to sort by, it creates a visual icon which allow us to set the sort direction of the forms data. We will generally place this token next to the column header, and should note that only the column which is currently being sorted by will have this icon displayed. |
| Flat Image | In some cases you will wish to display images in your forms result set. This token allows for this by creating a code snippet as such: <img src="<?php echo $row['image']; ?>" alt="" /> Thus, if your database had a column called 'image' where a directory of images contained the appropriate name stored in 'image', that image would be displayed in your form. It should be noted that their are other ways to display images, you could create your own image tag in the TinyMCE editor and assign the img src attributes to the Field Name Property with #{image}. |
| Function | In many cases you're data should be acted upon before display to the end-user. For example, a price field in the database might be a simple FLOAT value, which means it would not display well as a dollar value. For example, 17995.00 wohe value iuld be tn the database, but you want to display it as $17,995 to the end user.
The Function token allows us to accomplish this. When added the token will look similar to: #{*C_function_name()price} To use this field we would replace function_name with the name of a function we define in the Page PHP Head Code or Page PHP Top Code blocks of our page. For example, we could place: <?php In our Page PHP Head Code text area, and use this function token: #{*C_format_price()price} To echo out our price as $17,995, just as we wish our viewers to see. Cool Tricks and Hints Passing Multiple Values The basic idea is well CONCAT() two database field with a database View as in: CONCAT(var1, '|', LEFT(var2, 100)) AS var3 We then pass our alias as the parameter like: #{*C_functionCall()var3} And in our function code we simply explode() the params out: function link_description($in) We now access and process our fields as needed. Passing Multiple Values In Build 693+ However, as of Build 693 this restriction has been lifted, and we can now pass a comma delimited list of field names for the active query to our function. For example, lets imagine a scenario where we wish to display an 'add user' link if the number of volunteers for an event has not been met. Our function call in the repeater template would be: #{*C_func_openings()job_openings,job_id} And the function, now that we can accept more than one parameter, would be:
session_start();
function func_openings($ct,$job_id){
if($ct !== 0 && is_numeric($ct)){
echo "<a href=\"add_volunteer.php?job_id={$job_id}\">Sign Up</a>";
}
}
This is a very handy feature, and allows us great flexibility when creating 'smart' forms that react to our users input and other such conditions. |
| Search | The search token is used for creating text boxes that allow users to input search terms which are then queried against your data source. The search token is the most complex token, though in most cases you will not need to change most parameters. Please note that the search token must be used in conjunction with a search compatible template! Such templates are readily identified by the inclusion of + Search in the template name. However, you can always add your own search capability by including this code in your own templates: <form id="formboss_search" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> The basic search token look like this: #{*H_Search|id,=,OR,INT,textbox,15,,|} As with most tokens, the #{*H_Search part can be ignored, as that is only needed for FormBoss to identify what type of token this is. You only need concern yourself with the area in between the Pipe (|) symbols. The values of each comma delimited item are: field, comparison, join, datatype, display type, length of display item, default value, array of values, column alias Let's take each in turn: field comparison Please note that as of Build 710 we should now use LESS, LESS_OR_EQUAL, GREATER and GREATER_OR_EQUAL instead of <, <=, >, >=, respectively. This is because the TInyMCE text editor we create our templates in may end up transforming these symbols into HTML entities, breaking the query logic in the process. Thus, to be on the safe side use the new items! We can also use LIKE, though prior to Build 700 a limitation with the MySQLi driver prevented us from using this term, and thus it only worked with users employing the PDO extension. We chose our database extension when we install FormBoss. The good news again, is that as of Build 700 this is no longer an issue. If we do use LIKE, at this time we use a wild card search on both ends of the search term as in: %search_term% join Of course their are other logical operators such as AND and NOT. In FormBoss, your main concern is to make sure your logical operators and comparisons create queries that make sense for your form. For example, let's say we are searching for cars. We have three search fields, the first is Make, the second is Model, the last is Year. Someone searching for cars is often going to want to search by Make first, returning as many results for that make as possible. After they are happy with the make, they may want to narrow down their search by model and return only the makes + models of their choice. Recall that by default the join (logical operator) is OR. That means your search tokens would be: Make: #{*H_Search|make,=,OR,STRING,textbox,15,,|} Model: #{*H_Search|model,=,OR,STRING,textbox,15,,|} Year: #{*H_Search|year,=,OR,INT,textbox,15,,|} This presents a problem, because now when a user searches for say, Chevrolet and Corvette, your SQL will return just that, all the Chevrolets, and all the Corvettes. Our user only wants Corvettes, they are still getting all Chevrolets. In English, the query would be: Give me all Chevrolets or Corvettes. To fix this we need to change our join on model to be AND: Make: #{*H_Search|make,=,OR,STRING,textbox,15,,|} Model: #{*H_Search|model,=,AND,STRING,textbox,15,,|} Year: #{*H_Search|year,=,OR,INT,textbox,15,,|} In English, this query will now read: Give me all cars that are Chevrolet AND also Corvettes. If you've never written search queries before they can be a bit tricky. Take your time and experiment! data type display type radio select checkbox textarea Populating Radio, Select, and Checkbox Values The general rule is we can create two types of arrays: Simple and SQL. Simple Arrays <?php SQL Arrays <?php This array, when used to populate a repeater select item, will use the first sub-array element as the label of the item, and the second sub-element as the value. One useful way to remember this ordering is to think of the word love, the l comes before the v. Label first, then Value. Why is this important? So in the example above, the array('All', '') sub-element means the select item would show the text 'All' to the user, but pass an empty string as the value. To help drive the point home, the HTML for the select option created is: <option selected="selected" value="">Any</option> Notice how the value="" is empty, this is exactlly what we want to make sure our users select the 'All' option and have it work! This becomes absolutely essential when we want to use the 'Any' and 'All' text as in the example. In fact, this is a new feature to Build 671, in that when we used to 'break' using empty parameters in such arrays, we no longer do so. The end result of this is we can now show a label to our users of 'Any', 'All', or wherever else, but pass in an empty string to FormBoss for the search. So long as you have relaxed search checked on, this 'lack' of value passed to the search function will make FormBoss ignore the parameter, which means the result set returned will not be limited based on that field. In other words, the field is ignored unless a value is passed in, which is why we need to separate the label and value fields. We can pass a label to show the users, but not a value! Also new, in Build 673 we now have the ability, via Query Module items, to set just such a 'blank' value using the Append options. In short, we call our database to get values as normal, then add a Label to the append options and leave the value blank. This has the effect of creating our empty item so our users can select 'Any', 'All', and so on. For further demonstration of many of these fields and how they work, please see: http://www.formboss.net/help_support/formboss2/video/builder2-lesson-2.php @ 7:20 Checkbox/Radio Items For Display Only Hint We can see this in action via the sample job: Builder and Builder 2 > using-display-checkboxes.xml length of display item Please note that for textareas this value has two parts: width and hegith. By default these values are 15 and 5. default value array of values <?php ...or it can be the result of a Query call. In either case, the value supplied to this property must be in the form of a PHP variable. Thus, from the array defined just above in the sample PHP Top Code, our PHP variable is $ages, so we would populate the token as: #{*H_Search|age,=,OR,INT,select,15,5,,$ages,|} Column Alias This is needed for such forms because FormBoss will name the search fields the same as the column being searched. If we use this option however, we essentially override the search fields id and class attributes, which can make applying JavaScript logic to the element a touch more consistent. |
| Update | This field type lets you insert the value of the field as an updatable entry field.
The syntax of this token field is a little more advanced than others: A typical token will look like: *I_Update|id,textbox,INT,15,5,,| The descriptions of these fields follows: |field,type,DATATYPE,x,y,default,[$array item]or[upload size in bytes for file items]| field = the database field, this is created for you. type = The type of form field element to display to our users. Can be:
DATATYPE = prefilled datatype of field, no need to edit. x,y = For text fields x is the length of the field, for text areas x is the columns and y is the rows. default = the default value to provide, blank by default [$array item]or[upload size in bytes for file items] = Can be one of two values, depending on the database field type being updated. Checkboxes, Radio items, and select (combo) boxes For checkbox, radio, or select items this is an array of values to prefil the field with on page load. In many cases, you will want to make the name and value different, as would be the case with a security form where level 1 security would be labeled 'Guest', but in the the database, have a value of 1. To handle this, we must first consider the source of the data. If using a Query Module item to grab values from a database, we would write a query where we would grab the two values in the form of: label:value That is, the first field item will become the label used in the form item, the second would be the value. If using a raw array, we would construct our array such that the first index is the label, and the second is the value. Thus, we would create the array like so: $ages = array(array('mine',31), array('dads',60)); File Uploads For file-db items (file uploads) this value is the size in bytes of the max upload parameter, the default is 1 megabyte. A convenient way to calculate sizes in bytes is to say: 1024*1024 * the number of megabytes you want the field to be. So for example, to handle 5 megabytes we would: 1024*1024*5 = 5242880 bytes. Handling File Upload Data In Update Forms One of the most important parts of updating existing file data using a Builder form is to recall that most file uploads consist of two parts: a) the file data b) the files meta-data File Data Handing file uploads is pretty strait forward. If FormBoss finds a file upload field in the token chooser, when we click the Update token in the token chooser we'll automatically get a token in the format of: #{*I_Update|rawdata,file-db,STR,15,5,,1048576|} That is, a standard update token but set with file-db as the data type, and instead of an array value for the last parameter, the number 1048576, which means 1 megabyte maximum upload size. When we create our UPDATE SQL, the token chooser will automatically add this field to the list of variables, and when we choose it, the file upload should work as expected. File Meta-data Most of the time when we update a file upload we also want to update its associated meta-data. In FormBoss we always get three meta fields we can use for this purpose: _mime _filename _size Note the underscores: we includes those because when we want to access a file uploads meta fields we do so by taking the name of the database tables file field column (e.g., the BLOB field, the ones that holds the actual file data), and appending the _mime, _filename, or _size keyword to get that property. So for example, if the form has a database column called: rawdata To get the file uploads mime type and UPDATE the columns mime field, we would use: rawdata_mime In the Repeater Update Variable List. This is very important because it touches on a naming convention issue you should be aware of. Lets say we have a database table that saves the raw file data to the column rawdata. Now lets say we name the mime column for this item mime. In FormBoss then, doing this creates a slight disconnect, because now the Repeater Update SQL and Repeater Update Variable List areas will look slightly out of balance. This is because to update the file data we place the value rawdata in the Repeater Update Variable List. This matches the field name in the Repeater Update SQL block. However, the mime field, while shown as mime in the Repeater Update SQL block, shows as rawdata_mime in the Repeater Update Variable List. I know this is subtle, but had we named the database field rawdata_mime right off the bat, our two blocks would 'match', which makes creating and updating this form easier down the road. It's not of course required that we name fields this way, but it sure helps! Handling Checkbox Data In Update Forms Abstract The reason why we would do this is as far as FormBoss is concerned, any data being set as a checkbox item in a builder Update form will have this code run against it: $row = explode('|', $row['fieldName']); In short, we try to extract an array of values from the data. If this call succeeds, we will have a nice list of checkboxes that have matching values pre-checked. More Detail support@sample.com and/or sales@sample.com In the database, we would insert the data as: support@sample.com|sales@sample.com Notice the two email value as are separated by a pipe (|) Entering your data in this way means FormBoss Builder Update fields will automatically populate the update field as two separate values, as well as automatically 'check' any active values. Of course as a checkbox field we need to populate the checkbox options with an array, which we would do via a Query element or an array in the PHP Top Code block as in: <?php Our token would thus be: #{*I_Update|email,checkbox,STRING,15,5,,$emails|} When run, our checkbox options would be the two email address from the array, and if either of those values is already set in the pipe delimited list on our database, the checkbox for that item would be checked automatically. One final note, you will notice that by default, the SQL+ modules 'Array Based Variables Separator' value is set to the pipe (|) symbol for seamless integration with any Builder forms. For more please see: http://www.formboss.net/help_support/formboss2/video/builder2-lesson-2.php @ 9:00 As well as the sample job: formboss2\goodies\Sample Jobs\Builder and Builder 2\Car Update Job Handling UPDATES for native TIMESTAMP and DATETIME fields. New in Build 701 are several improvements of how native datetime and timestamp fields are handled. Please read below for full details and information. When dealing with MySQL or MSSQL DATETIME or TIMESTAMP fields we are in essence dealing with a very specific SQL data format that must be met or our updates will not work. Specifically, a DATETIME or TIMESTAMP field sent to the database for an update must be in the format of: 2012-02-15 14:14:05 The trick is that this is not the most convenient format to view a date. Many visitors will instead prefer a more traditional 02/15/2012. Because of this extra complexity one might be tempted to ignore the native date formats and instead use standard VARCHARS. We could, but then we loose all the benefits that come with the date formats, such as easy sorting and searching. Thus, for most uses the native date formats are a fact of life. However, if we do not need to sort or search based on a date and instead simply need a date as a display element, by all means feel free to use simple text fields. If however, we need to sort or search based on dates, or we simply have no choice in the matter and must use a TIMESTAMP or DATETIME field, read on! Implementing a Logical Date Solution In FormBoss then we attempt to address both sides. Viewing DATETIME/TIMESTAMP Values By default we use American, and we can see this via the token FormBoss creates for us: #{*I_Update|ts,calendar,TIMESTAMP_A,25,5,,|} The important part is the TIMESTAMP_A bit. TIMESTAMP is the field type, and is set by FormBoss automatically. The_A part though, that's of interest to us if we're in Europe. If we are in Europe, we want to change this to be _E, as in TIMESTMP_E. The same is true for the DATETIME token. If we need European formatting change the _A to be _E. Updating (typing) DATETIME/TIMESTAMP Values By default, when we add a token of a DATETIME or TIMESTAMP database field FormBoss will alert us that it's gone ahead and enabled the jQuery UI - Core Modules include under Page Properties > Page JavaScript/Head Code. We do this as now we'll get a nice datepicker for that field automatically. This means a user can easily select date values from a calendar instead of hand typing them. Behind the scenes, FormBoss will now turn the form field being used to display the date into a proxy, in that the real date value being sent to the database is now stored in a hidden field just below the form field. That way the user only experiences the 'pretty' dates, but the database gets valid values. |
| PK | Used in conjunction with the UPDATE and DELETE feature, this value must be supplied to any form wishing to use either of those operations. This value is best defined by the PK of your database table, if available. |
| Hidden | This field is simply a hidden field item which can help you create custom update or delete logic. |
| Data Type | This is the internal data type of the column as defined in the database. It is more for reference than anything, and is not used as a token in FormBoss. |