Hello, how can we help you?

Recent Searches: Configuring timestamps - SoftExpert Asset widgets - Workspace - 2.2.3 - Workflow - 2.2.3

Creating functions

 

Prerequisites

  • Access to the File > Form (FO005) menu.
  • Previously created and designed responsive form.

 

Introduction

Functions are used to manipulate and fetch values in the form. They can be associated with rules and expressions applied to form fields, as well as with other functions.

Functions allow for rounding the values of a decimal field, changing the text inserted in a field from lowercase to uppercase, entering days in date fields, etc.

Since the case study is being carried out from a travel request form, to illustrate the use of the functions, we will create and apply a function so that the requester's name is automatically filled with the name of the user logged in to the system.

See how to create a function:

 

How to create a function

For more details on rule creation, refer to the Configuring rules in the responsive form article.

For more information on associating and filling out a form in process activities, refer to the Associating forms with process activities and Filling out forms when executing activities articles.

 

 

Options available for the Value source

Form field

Allows for using the value of a certain form field in the condition.

It is possible to verify if the field has been completed or compare the value of the field with another value, which may be a fixed value or the value of another form field.

After selecting the option, fill in the fields:

  • Value: select the form field that will be used in the condition. All form fields that can be completed will be available for selection.
  • Operation: if part of the form field value needs to be refined or extracted in order to be used in the condition, select an operation. The operation options vary according to the value type of the form field.
 
 

Variable

Allows for using a table variable in the condition.

After selecting the option, fill in the fields:

  • Value: select the variable that will be used in the condition. All variables created in the table will be available for selection.
  • Operation: the operation options vary according to the value type of the form table variable.
 
 

Expression

Allows for using a form expression in the condition.

After selecting the option, fill in the fields:

  • Value: select the expression that will be used in the condition. All expressions created in the form will be available for selection.
  • Operation: the operation options vary according to the value type of the form expression.
 
 

Function

Allows for using a form function in the condition.

After selecting the option, fill in the fields:

  • Value: select the function that will be used in the condition. All functions created in the form will be available for selection.
  • Operation: the operation options vary according to the value type of the form function.
 
 

User data

Allows for using user data for the condition. User data comes from the workflow in which the form will be filled out.

After selecting the option, fill in the fields:

  • Value: select which piece of user data will be used in the condition. The data available for selection is: user's ID, name, department, or position
  • Operation: the system provides operations that allow for manipulating a value of the Text type originated from the user's data.
 
 

Process instance data

Allows for using instance data for the condition. Instance data originates from the workflow in which the form will be filled out.

After selecting the option, fill in the fields:

  • Value: select which piece of instance data will be used in the condition. The data available for selection is: ID #, title, description, status, priority, activity data, data of the activity requester or starter.
  • Operation: the system provides operations that allow for manipulating a value of the Text type originated from the instance data.
 
 

Related-table data

Allows for using the data of the related table for the condition. 

After selecting the option, fill in the fields:

  • Table: select from which table the information will be fetched.
  • Table field: select from which table field the information will be fetched.
  • Operation: the system provides operations that allow for manipulating values originated from the table field.
 
 

Date

Allows for using the current date (today) in the condition.

After selecting the option, fill in the fields:

  • Value: the condition can use today's date (dd/mm/yyyy).
  • Operation: the system provides operations that allow for extracting a certain date value (dd/mm/yyyy). It is possible to extract the day (dd), the month (mm), or the year (yyyy) from the date, obtain the weekday of the date (as to the year), or obtain the weekday corresponding to the date. Note that all values obtained with the operations will be values of the Integer type. 
 
 

Time

Allows for using the current time in the condition.

After selecting the option, fill in the fields:

  • Value: the condition can use the current time (hh:mm).
  • Operation: the system provides operations that allow for extracting a certain time value (hh:mm). It is possible to extract the hours (hh) or the minutes (mm) from the time, convert the time to minutes, or convert the time to seconds. Note that all values obtained with the operations will be values of the Integer type. 
 
 

Date and time

Allows for using the current date and time, in text format, in the condition.

After selecting the option, fill in the fields:

  • Value: the condition can use the current date (dd/mm/yyyy) and time (hh:mm).
 
 

Geolocation

Allows for using geolocation data in the condition.

After selecting the option, fill in the fields:

  • Value: the condition can use longitude (degrees) or latitude (degrees).
  • Operation: the system provides operations that allow for storing values referring to latitude and longitude. These values can be stored in form fields and used in integrations with map APIs.
 
 

Risk

Allows for using risk data in the condition.

After selecting the option, fill in the fields:

  • Value: the condition can use data originated from a risk plan, risk, control, opportunity, and risk evaluation.
  • Operation: the system provides operations that allow for manipulating values of the Text, Integer, or Decimal type originated from risk data.
 
 

 

Operations

Operations available for selection

Operation Description Fields
Uppercase Select this option to use the field text in uppercase letters in the condition. Text, Paragraph, Option group, and Simple list.
Lowercase Select this option to use the field text in lowercase letters in the condition. Text, Paragraph, Option group, and Simple list.
Remove spaces Select this option to use the field text without spaces in between words, if any, in the condition. Text, Paragraph, Option group, and Simple list.
Year Select this option to use, in the condition, only the year (yyyy) of the date (dd/mm/yyyy) entered in the field. For example, if the value inserted is 31/12/2023, the condition will use the value 2023. Date
Month Select this option to use, in the condition, only the month (mm) of the date (dd/mm/yyyy) entered in the field. For example, if the value inserted is 31/12/2023, the condition will use the value 12. Date
Day Select this option to use, in the condition, only the day (dd) of the date (dd/mm/yyyy) entered in the field. For example, if the value inserted is 31/12/2023, the condition will use the value 31. Date
Weekday Select this option to use, in the condition, the weekday of the date entered in the field. The days of the week will be returned as numbers for the condition, starting the count from Monday, that is, Monday is 1, Tuesday is 2, Wednesday is 3, Thursday is 4, Friday is 5, Saturday is 6, and Sunday is 7. Date
Week number Select this option to use the number of the week related to the year in the condition. For example, 40 indicates that the date is in the 40th week of the year. The week count starts on Monday, that is, the system considers the week to go from Monday to Sunday. Date
Deny Select this option if it is necessary to deny the value to use it in the condition. For example, if the value is checked (true), the condition will use the unchecked value (false). Checkbox
Absolute Select this option to use, in the condition, the absolute value of the number entered in the field. For example, if the value inserted is -10, the condition will use the value 10, that is, |-10| = 10. Decimal and Integer
Square root Select this option to use, in the condition, the square root of the number entered in the field. For example, if the value inserted is 25, the condition will use the value 5, that is, √25 = 5. Decimal and Integer
Factorial Select this option to use, in the condition, the factorial of the number entered in the field. For example, if the value inserted is 5, the condition will use the value 120, that is, 5! = 5 * 4 * 3 * 2 * 1 = 120. Decimal and Integer
Round up Select this option to use, in the condition, the rounded-up integer value of the number entered in the field. For example, if the value inserted is 7.1, the condition will use the value 8. Decimal
Round down Select this option to use, in the condition, the rounded-down integer value of the number entered in the field. For example, if the value inserted is 7.9, the condition will use the value 7. Decimal
Round Select this option to use, in the condition, the rounded value of the number entered in the field. For example, if the value inserted is 7.4, the condition will use the value 7; however, if the value inserted is 7.6, the condition will use the value 8. Decimal
Truncate Select this option to use, in the condition, only the integer part of the number entered in the field. For example, if the value inserted is 42.22, the condition will use the value 42. Decimal
Hours Select this option to use, in the condition, only the hours (hh) of the time (hh:mm) entered in the field. For example, if the value inserted is 15:26, the condition will use the value 15. Time
Minutes Select this option to use, in the condition, only the minutes (mm) of the time (hh:mm) entered in the field. For example, if the value inserted is 15:26, the condition will use the value 26. Time
Convert to minutes Select this option to use, in the condition, the value of the time entered in the field converted to minutes. Time
Convert to seconds Select this option to use, in the condition, the value of the time entered in the field converted to seconds. Time
Automatic translation Select this option to translate the text inserted in the field. Text, Paragraph, Option group, and Simple list.
 
 

 

Conclusion

All done! Now you know how to create functions in the form. See how to configure expressions and rules in a responsive form.


Was this article helpful?