6. Form finisher¶
Target group: Integrators, Developers
Table of Contents
Transmit data¶
A form finisher JobRouterTransmitData
is available to transmit form fields to
a JobData table. After submitting a form, the form values are stored in a
transfer table. A command, hopefully executed regularly, takes these transfer
records and transmit this data. This is due the fact, that a JobRouter®
installation can be temporarily not available due to maintenance or network
problems. Also the submitting of a form should be as fast as possible for
better user experience.
Note
The finisher can only be used in the yaml form definition, not in the Forms backend module.
Transmit to a JobData table¶
So, let’s start with an example. The form finisher is defined in the YAML configuration of the specific form:
finishers:
-
identifier: JobRouterTransmitData
options:
handle: 'website_contact'
columns:
name: '{preName} {lastName}'
company: '{company}'
email_address: '{email}'
phone_number: '{phone}'
message: '{message}'
source: 'Website'
The handle
is required as it connects the fields to the appropriate
table link.
You can map the form fields to the JobData columns. As you can see in the
example above, you define the JobData column as the key (e.g email_address
)
and then map it with the value to be stored. This can be the form field
identifier which is enclosed in curly brackets (e.g. {email}
), a static value,
a combination of a static value with a form field or even multiple form fields.
Note
Only columns that are configured in the table link are possible. If a column is used that is not defined, an exception is thrown.
If the value of a form field is an array, like from a multi checkbox, the array is converted to a csv string and stored in the given process table field.
Start multiple transmissions¶
It is also possible to start multiple transmissions – even on different
JobRouter® installations. Just use the array notation in options
:
finishers:
-
identifier: JobRouterTransmitData
options:
-
handle: 'website_contact'
columns:
name: '{preName} {lastName}'
company: '{company}'
email_address: '{email}'
phone_number: '{phone}'
message: '{message}'
source: 'Website'
-
handle: 'anonymous_messages'
columns:
ANON_MESSAGE: '{message}'
FROM_URL: 'https://www.example.com/demo'
Variables¶
You can use variables as column values. For more information have a look into the available variable resolvers. You can also write your own variable resolvers.