Skip to content

Tagify - Creating New Tags and Storing them in the Database

Original guide · All levels

Intro Sometimes, when using Tagify you want to be able to allow users to create new tags in addition to the ones already created and listed in Tagify. That’s useful when adding a new article or produc

Sometimes, when using Tagify you want to be able to allow users to create new tags in addition to the ones already created and listed in Tagify. That’s useful when adding a new article or product with categories - so that users can create new categories directly using Tagify.

In this tutorial we have a simple insert record form for adding a new article:

Inside the form we have a category input, which is a dynamic Tagify control:

Section titled “Inside the form we have a category input, which is a dynamic Tagify control:”

We’d like to allow users to add their own custom categories here.

Section titled “We’d like to allow users to add their own custom categories here.”

First, let’s setup the server-side part.
Open the Server Connect panel and add a new API Action:

Open the Input section and add a new variable under $_GET:

Section titled “Open the Input section and add a new variable under $_GET:”

Close the input section and add a new step under Execute:

Section titled “Close the input section and add a new step under Execute:”

Under Database Actions select Database Insert:

Section titled “Under Database Actions select Database Insert:”

And then we select the categories table, where we store our categories for the Tagify:

Section titled “And then we select the categories table, where we store our categories for the Tagify:”

Click the dynamic data picker for the category name, to change the default value there:

Section titled “Click the dynamic data picker for the category name, to change the default value there:”

Instead of it, select the category GET variable which we created already:

Section titled “Instead of it, select the category GET variable which we created already:”

And we are done with the server-side part.

Section titled “And we are done with the server-side part.”

Close the Server Connect panel and open the insert article page.

In order to get the custom added tags and insert them in the database we will use a page flow. Right click App:

First, we need to add two parameters for the flow. One that checks if the added tag is new/custom and another one that gets the tag value.
Right click $param:

Now we need to add a logic which inserts the new tag if it is custom/new. Right click Execute:

Section titled “Now we need to add a logic which inserts the new tag if it is custom/new. Right click Execute:”

And select a dynamic value for the condition:

Section titled “And select a dynamic value for the condition:”

Here, we select the isCustom parameter under Page Flow > $param:

Section titled “Here, we select the isCustom parameter under Page Flow > $param:”

Under Data Sources, select Server Connect:

Section titled “Under Data Sources, select Server Connect:”

We select the category_insert server action, which we created earlier:

Section titled “We select the category_insert server action, which we created earlier:”

You will see the category parameter under Input Parameters. Select the dynamic data picker button in order to pick a value for it:

Here, we select the category parameter under Page Flow > $param:

Section titled “Here, we select the category parameter under Page Flow > $param:”

Now as we have our flow set up, we need to run it when a new tag is added in the Tagify input.
Select Tagify and add new dynamic event:

And then click the dynamic data picker for the isCustom parameter:

Section titled “And then click the dynamic data picker for the isCustom parameter:”

Select the isCustom value under the Add Event:

Section titled “Select the isCustom value under the Add Event:”

And you are done.
The last thing left is to reload the data source, used to display the categories from the database when a new tag is added to the database.
In order to do this select your flow and add new dynamic event:

Select Load under the server action used in the Tagify:

Section titled “Select Load under the server action used in the Tagify:”

Save your page and you are done.
Now you can add new custom tags in the Tagify where you select your categories: