Showing posts with label Expressions. Show all posts
Showing posts with label Expressions. Show all posts

Sunday, August 31, 2014

Using Scheduled Workflows for Recurring / Periodic Tasks

While iFreeTools already has support for database-trigger based workflow execution, which can execute tasks like sending out email or SMS, adding of new records or editing existing records in database and for re-indexing records (to recompute formula field values), there can be automation scenarios wherein some workflows need to be triggered periodically, for a specific set of records.

Examples of such scenario can include,

  • sending out emails for birthdays,
  • sending an SMS when the expiry date is nearing,
  • recomputing formula fields of specific records (for example the formula field for Age can be recomputed for records which have Date of Birth on that day).

To enable automation for such scenarios, we have enabled support for Scheduled Workflows.

As a specific example, let us consider a subscriber database which needs to be notified about the upcoming renewal date for their subscription.

The actions to perform in this example, has an email configured to be sent to the subscribers about the upcoming renewal date, like shown below.


The full work-flow configuration for the sample scheduled workflow is given below, with the relevant sections highlighted in green.

Apart form normal workflow configuration details like Workflow NameDescriptionEntity and Status, for the Scheduled Workflow configuration, the Trigger During value needs to be specified as Schedule. The other non-relevant sections of the configuration page can be left with the default values.


Under the Schedule Setting section, we have specified the Schedule Interval to be Every Day, but since we want this to execute only on the 1st of every month, we add a Schedule Criteria Expression as day(now()) == 1 . On the other days, the expression will evaluate to false and will not fetch the records to execute the actions.

The Records To Fetch When Scheduled specifies that only the records which have the Renewal Date in the next month needs to be fetched, for which the specified actions will be executed.

All actions performed during the Scheduled Workflows will be audited under scheduled-workflow-user account.

Scheduled Workflows will be a premium feature available for paid customers. For efficient use of computing resources, the scheduling options will be disabled by default in the paid single-tenant deployments and can be enabled on request.

Hope you find this feature. Feel free to let us know your feedback on how we can enable more such automation for you.

Tuesday, October 29, 2013

Specifying default values for form fields, using expressions

iFreeTools Creator, your easy web-based database software built for hosting on Google App Engine, now supports specifying default values for attributes in forms. The default values can be configured using the Default Value Expression in Attribute definition.


Expressions should return the result in the expected data-type. For details on using expressions, you may refer to our help docs.

Sample default value expression for each data type are given below:

Data Type

Examples

Single/Multi-line Text

  • "Velachery"
    Text values have to be provided within quotes.
  • val_from(user(), "Name")
    to set the currently logged-in user's name.
  • val_from(user(), "Email Id")
    to set the currently logged-in user's email-id.
Yes/No checkbox (Boolean)


  • True
  • False
  • val_from(user(),"Role") == "admin" to mark as Yes, if the current user has admin access.
Number Integer/Decimal numbers
  • 1
  • -2
  • 33.5
  • -44.75
  • val_from(fetch_one("Fee Details", "Year":year(), "Month":month()}), "Fees"))
    to fetch the values form an existing database record, in this case, from Fee Details entity, which matches the condition of having the Year attribute as the current year and the Month attribue as current month. From this matching record, we get the default-value from the Fees attribute.
Single line text - Choice Value

  • "Cash"
    Any of the choice values can be provided. For example, the above is valid if the choice values were : "Cheque", "Cash", "Bank Transfer"
Date
  • today()
  • today() + timedelta(5)
    to set the date value as 5 days from the current date.
Date and Time
  • now()
  • now() + timedelta(0,3600*10)
    to set the date-time value as 10 hours from the current date-time.
Image
  • key_id(val_from(fetch_one("Default Values",{}), "Default Profile Image"))
    to fetch the image form an existing database record, in this case, from Default Values entity, having an image-attribute with name as Default Profile Image.
Geographical Location (Geo Point)
  • "13.1207829,80.2377078" 
    in case you know the co-ordinates of a specific location, the value has to be provided within quotes.
  • val_from(fetch_one("Default Values",{}), "Default Location") 
    to fetch the location form an existing database record, in this case, from Default Values entity, having an geo-point-attribute with name as Default Location.
List (with string values)
  • ["English", "Spanish", "French"]
  • val_from(fetch_one("Default Values",{}), "Default Languages")
    to fetch the values from an existing database record, in this case, from Default Values entity, having an list-attribute with name as Default Languages.
Lookup field (Reference)
  • key_id(fetch_one("Teacher",{"Name":"John Smith"}))
    to fetch the values from an existing database record, in this case, from the Teacher entity, having Name as John Smith.

Hope you like our new feature. If you need assistance in using this feature or if you have suggestions, feel free to use the feedback form in our application.

Tuesday, August 30, 2011

Now available : Data aggregation in list/chart views, Data-access & Caching functions and more..

Over the month we have rolled-in the following features in your free online database app builder and free online crm, built over Google App Engine for use with Google Apps.
  1. Data aggregation in list views & chart views
  2. Data access and Caching functions
  3. Search for files to attach from Google Docs

Data aggregation in list views & chart views

Numeric attributes (integer and float types) can now have a Default Aggregation configured to display the sum of the fields' values in the list views and in the chart views.

In our iFreeTools CRM, our free CRM app for use with Google Apps, we have enabled this for fields in Expected Revenue, Budgeted Cost and Actual Cost fields in Campaigns and for Amount and Expected Revenue in Opportunities.

The summation of the values from such fields will be listed below the list view as shown in the image below..


Along with this we have also enabled the result of aggregation from multiple attributes to be rendered in the same graph, so that you can compare related aggregation values visually.

The following image shows the chart views for Campaigns enabled to display values from 3 attributes, Expected Revenue, Budgeted Cost and Actual Cost, grouped by Campaign Status..


For your custom online database apps, built over iFreeTools creator you can specify this configuration in the Attribute form, when you add/edit the attribute details.

Note : All aggregation / charting features are currently restricted to work with smaller batch of data. When our Scheduled Reports feature is available, you can create summary / charts for full set of data.

Data-access and Caching functions

New data-access and caching functions listed below have been now added for use with expressions.

user
Usage : user()
Description : Returns the currently logged in user

fetch_one
Usage : fetch_one(entity_name, criteria)
Description : Returns a record for the given entity_name and filtering criteria
Example : fetch_one("Car", {"Company":"Honda", "Name":"City"}) will fetch a record from the entity having Display Name as Car and for the filtering condition to get the record for Honda City.

val_from
Usage : val_from(instance, prop_name)
Description : Returns a value of a property from the given instance.
Example : val_from(user(), "emailId") will return the current user's email-id, where emailId is the alias for the "Email Id" attribute in User system-entity.

cache
Usage : cache(name, expr)
Description : To cache the result of evaluation of expression expr with the given name.

cached_val
Usage : cached_val(name)
Description : Returns the value which was added to cache previously with the given name.


For more details, refer to Data Access and Cache Functions section the user guide.

Search for files to attach from Google Docs

When attaching files from Google Docs to your records, you now have the option to search for the required file based on text, to narrow down the files and attach the required file to your record.


Hope you like the new features.

Do keep sending in your suggestions on how we can make things better in your free online database app builder.

Friday, July 29, 2011

Date-Time and Error Functions now available for use within Expressions

Your favorite online database app builder tool over Google App Engine - iFreeTools Creator, now supports date-time functions within formula field expressions and in validation expressions.

The new date-time functions made available are listed below :


now
Usage : now ()
Description : Returns a datetime object having the current time.

date
Usage : date(year, month, day)
Description : Returns a date object for the given year, month and day values.

datetime
Usage : datetime (year, month, day, hours=0, minutes=0, seconds=0)
Description : Returns a datetime object for the given parameters. If hours, minutes and seconds are not provided, they will be taken to be 0 (zero).

timedelta
Usage : timedelta (days=0, seconds=0, microseconds=0)
Description : Returns a timedelta object representing a difference in time, for the given days, seconds and microseconds. Can be used to add or subtract date/datetime values.
Example: now() + timedelta(1) will give tomorrow's date and time.


We have also added support for raising error messages when validating values using expressions. Apart from detailing on how to enter the value for the field in the description, this function will enable you to specify the reason for the validation failing.


error
Usage : error(error_msg)
Description : Raises an error with the given error_msg. This will be shown in the form for the corresponding attribute which failed the validation expression.


We have also rolled in a new home page for iFreeTools Creator, now highlighting the important features available in the platform.



Keep sending in your valuable suggestions on how you think we can make iFreeTools better for you.

Wednesday, June 29, 2011

Expressions for Computed Formula Fields & Field Validations, now available in iFreeTools

The labs setup of the Google App Engine powered free online database apps creator, now has support for defining and using expressions for calculated formula fields and in validations.

Update : it is now available at http://creator.ifreetools.com too.

Note : When adding new formula expressions, you will need to re-index the existing records to have the formula value computed for those entries.

Formula Expressions

You can now define expressions based on values in other fields in the database record to compute the value of formula field.

For example, you might have First Name and Last Name as fields within your database record and may prefer to have them combined in another Name field. For this you can add the 3 attributes with data-type as Single line text (String) and for the Name attribute you can set the Formula Expression (under Advanced section of the attributes form) to be

val("First Name") + " " + val("Last Name")

The val function enables you to fetch the value of the field for a given display name.

The formula expressions can be set for any data-types, just make sure the return value of the expression is of the required type.

Aliases for fields

You can also set Aliases for the attributes and use them instead of the val functions, to have the formula to be something like

First_Name+" "+Last_Name

Validation Expressions

You can also define validations expressions which need to evaluate to True for the record to be stored into the database.

So, if you have a product code field and it should always be 5 characters in length, you can set the Validation Expression as

len(inputValue) == 5

For more details on the operators and functions available for use within expressions, kindly refer to Using Expressions for Formula-fields and Validations, in our user guide.


Hope you like the new feature. Do keep sending in your suggestions on how you believe we can make this app better for you.