beautypg.com

For every record in a table, For loop, Import data into database – QuickLabel PowerForms User Manual

Page 15

background image

- 15 -

For Every Record in a Table

The property defines the table. All records or all selected records from the table will be used   in the 
defined actions.

Table: Select the name of the table you want to use.

Use selected records only: Enable this option to use only selected records in the defined actions, 
not all records in the table.

Note: The database table must already be defined on the form.

Condition: This is a scripting boolean expression. Only two results are possible (True and   False). 
Use this option to enable current action only when some term is   met. The action will be started only 
if condition returns True as the   result of the expression.

For Loop

For loop makes it possible for the action to be executed a certain number of times.

Loop from: Select a starting value for the incremented loop.

Loop to: Select an end value for the incremented loop.

Note:
If the loop from value is higher than the loop to value, the loop will decrement the value regressively. 

The Loop from and Loop to values can be fixed or variable, and the current loop value can also be 
saved into a variable.

Condition: This is a scripting boolean expression. Only two results are possible (True and   False). 
Use this option to enable current action only when some term is   met. The action will be started only 
if condition returns True as the   result of the expression.

Import Data Into Database

Here you can define the action that will take data from the text data file and import it into the SQL 
database.

Before you can use this action, you must already create a connection to the SQL database. The 
action does not work with file-based databases, like Microsoft Access, or data files like Microsoft 
Excel, or plain text files. You must use server-based SQL database, like Microsoft SQL.

Note: The action is only available for forms running on the Web platform, not for forms running on a 
desktop platform.

Rules:

 

l

The first line in a text file must define field names

 

l

The field names in the text file must match field names in the database table

 

l

If the text file does not provide a value for some field, NULL will be written to the data-
base. If the field does not accept NULL values, then the empty string "" will be written.

 

l

Setting values for auto-incremental fields is ignored. The database will provide value for 
such field, value for such field from the text file is ignored, but the rest of the fields in a 
record will be written to the table.

 

l

If the value from text file does not match the structure of the field, the action is canceled 
and error message displayed. E.g. you want to write alphanumerical value into numerical 
field.