Formulas may involve functions, numeric operations, logical operations, and text operations that operate on fields
A formula is a method to access every piece of data and build up to as complicated a data flow pattern as you need it to be. You can combine, modify or calculate the values, or you can even pull up an access control system based on logical conditions set by an appropriate formula.
In a formula, you can reference columns by name. For example, if you wanted a formula that calculated the total based on the price and quantity, the formula would look like:
= Price * Quantity
or you would like to concatenate first name and last name fields from your Table, it looks like:
Let's see how you can make use of Jet Admin formulas.
For an introductory example, we will consider feeding customers email addresses to promotional email. Once the user is selected in the Customers table, his or her email should appear in the
1. Click on Value text area. There will be a pop-up window. Then select Customers table -> Clicked row (the value will pass once you click a row) -> User email. The Value field will be populated with the following expression:
2. Now we will configure the Subject field using the
CONCATfunction. Let's say we want to select an appropriate value from the Discount dropdown list and have it automatically passed to the Subject field of the promotional email in the following form: "Manuel Allen - 15% discount":
=CONCAT(elements.Customers["0"].selected_item.username, " - ", elements["Discount"].value)
3. To finish up, we shall configure the Body field. Using the
CONCATfunction we will build a template for the email body:
=CONCAT("Hi ", elements.Customers["0"].selected_item.first_name, ", here is your promocode: ACX978DF.")
4. Now when you select any customer, it will launch a completely automated process to create a promotional email to treat this customer. The only manual job remaining for you will be to select the discount and hit the Send email button:
In this use case we will create a custom column in the Customer table and calculate a score depends on some logical condition.
1. Simply create a new Custom field in columns settings of table component.
2. Now we should configure Value for that Column using Formulas. We will use
IFfunction to calculate Scores value, depending on Activities number for each customer:
=IF(item.activities < 280, '50 points', IF(item.activities < 400, '70 points', '100 points'))
Essentially, this is a tabbed pop-up window which reflects all the components on the current page, a list of functions and a set of filters to manage data in the selected table.
The number and type of tabs depends on the context. This allows the user to have access to only those tools which are applicable to the objects he or she is working with. For example, if we work with table parameters, there will be a tab with filters. In case we drill down to a specific record of a table and have this record fields displayed on a page, a tab with Record components will be available:
When you configure the table parameters, the features displayed in the Formulas window will fit the component context, e.g. there will be a new tab with
Filtersto set up filtering for selected table or a tab with User properties if any exists. Let's walk through the possible context Tabs.
In this tab you see a general list of all available interactions with the current component or other components and parameters.
When you are working on a Current Component setting, the context in the formulas will show you the Current Component setting at the very top. In this tab, you can only access the fields in the current component:
Here you can access any data from your resources through any component (fields, tables, charts, etc.) on the current page.
If you want to restrict access for a User or a Team to data that is relevant for their work within a JetAdmin app, you can quickly access the User & Team properties in these tabs and assign the user or team ID to the data columns which should be visible for them:
You can create custom columns in a table to handle cases such as math operations on your data, parsing JSON fields, or creating conditions. Let's look at a few examples of how to use it: