Applying Text Data Formatters and Adding a Default Value

Applying Text Data Formatters and Adding a Default Value

Learn how to use text formatters and apply the default value formatter

With this movie we will show you how to use the text formatters included, in the DMXzone Server Data Formatter. Also we will show you how to apply the default value formatter.

Step by Step

We will show you how to use the text formatters included in the DMXzone Server data formatter (1). We created a form, which inserts contacts into our database. We'd like to format the text inserted from the text fields, and the text area. Also we'd like to send a default value, to the database when the checkbox is not checked (2). the value of the checkbox is yes but we want to send no when it is not checked (3). the value of the checkbox is yes but we want to send no when it is not checked (4). You already know how to create an insert record action so we won't show you this again. This is our insert record step. Let's open the insert record options and format the values (5).

First and last names

We'd like to make sure, that the first and last names inserted into the database are always the same format. The first letter must be a capital letter and it should be followed by lowercase letters. Select the first name in the columns list (1). And select the dynamic value button (2).

Then click the server data formatter button in order to format the value, coming from the selected post variable.

Then click the value(1). And click the add new formatter button (2).

Open the text formatters menu (1). And select the titlecase string format (2).

Then, click the select button in order to apply the format (1). And click the select button (2).

We do the same for the last name.

Now, let's apply a lowercase filter to our email values (1). And then, click the server data formatter button (2).

And then, click the server data formatter button. Select the email value (1). And add a new formatter (2). Under text select- convert to lower case (3).

inserting the record

Apply the selected format. And click the select button. Then, select the info field. Its value comes from a text area. Sometimes, when we copy text around there may be some HTML tags left in it. We want to make sure , that they are removed, when inserting the record (1). So, click the dynamic data button (2).

And open the server data formatter . Select the value (1). And add a new formatter (2).

Under text, select strip tags. And apply the selected format. Then click the select button. Now, let's add the default format to the checkbox. Click the chekbox field (1). Then, click the dynamic data button (2).

Add new formatter

And open the server data formatter. Select the value, and add new formatter (1). Open the general menu (2). And select the default format (3).

and enter the default value. We enter no (1). Apply the selected format (2).

Save results

Click the select button. And click OK. Save your action file. And we are done. Let's preview the results.

End Results

We enter the first, and last name in lower case. Then, we enter the email in both and upper case letters. Then let's add some HTML tags in the additional information text area. We do not check, the checkbox so that it should insert no as a value. Then add the contact, and check the results in our database table. You can see that the first, and last names are properly formatted starting with capital letters. The email is all lowercase, the info field html tags are stripped and the checkbox default value is inserted. That's how easy it is to use the DMXzone Server Data Formatter in order to format the data inserted into your database.

Extensions Covered

Comments

Be the first to write a comment

You must me logged in to write a comment.