Expressions for Values 

Functions to concat, add days, sub days, etc used for calculating and updating values.

Expressions interpretation
    Expressions allow you to use fields to form calculate expressions, and the functions perform computations such as concatenation, addition, and subtraction of days, etc. It supports standard & custom fields.


Where are Expressions used?
    In Workflows’ Update Fields and Create Record actions, you have the option to update field values by using expressions that could be a calculation based on a combination of different fields. 


List of Expression Functions:

  1. concat

        This function combines two fields, you can use this especially to combine Text fields.

    For example, if you have a field called Full name, you want to combine the first name and the last name and update in Full name, For this, you must use the function Concat(firstname,lastname).



  2. time_diffdays(a,b)

        This function takes Date fields as input. It calculates the difference of time in days between the two fields.

    For example, you want to know the Support Period of a contact. The difference can be calculated using time_diffdays(support_end_date,support_start_date).



  3. time_diffdays(a)

        This function provides the difference between the current date and a Date field.

    For example, You want to know how many days have passed since a case was created. For this, you must use the function time_diffdays(createdtime).

    In the background, the function operates in this way:
    Current date - Created time.


  4. time_diff(a,b)

    This function takes Date fields as input and calculates the difference of time between the fields in seconds.

    For example, to update the Task Progress Time depending on the Created Time and Modified Time of a record, For this, you must use the function time_diff(modifiedtime,createdtime).

    In the background, the function operates in this way: 
    Modified time - Created time.


     
  5. time_diff(a)

    This function gives the time difference in seconds between the current date and a Date field.

    For example, you want to know how many seconds have passed since an internal ticket was created. For this, you must use the function time_diff(createdtime).

    In the background, the function operates in this way:
    Current date - Created time.



  6. add_days

     This function allows users to Calculate a new date. It takes two inputs a Date and a Number, It adds the number to the date and results in a new date field.

    For example, you want to provide a customer with a support period of 30 days and update the end date in the Support End Date field. The function would be add_days(support_start_date, 30), where the first parameter is a Date field and the second parameter is the number of days.

    So, add_days(01-06-2021,30) will result in the date field as 01-07-2021.


     
  7. sub_days

    This function allows users to calculate a new date. it takes two inputs a Date and a Number, It deducts the number from the date and results in a new date field.
     
    For example, To identify a date to send an email to a customer 3 days prior to their Subscription End Date.
    For this, you must use the function sub_days(datefield, noofdays) where the first parameter is a Subscription End Date on the "date field" and the second parameter is provided the required number of days to subtract.

    So, sub_days(04-06-2021,3) will result in the date field as 01-06-2021.



  8. add_time(timefield, minutes)

        This function allows users to Calculate a new time by adding the specified time and minutes.

    For example, consider that an educational institution is conducting an online test. To update the end time of the exam.

    For this, you must use the function add_time(timefield, minutes).where the first parameter is an Exam Start Time on the "time field" and the second parameter is provided the required minutes to add.

    So, add_time(09:00:00, 180) will result in the Exam end time field as 12:00:00.



  9. sub_time(timefield,minutes)

    This function Calculates a new time by subtracting the specified minutes from the specified time.

    sub_time(timefield, minutes) where the first parameter is a Specified Time on the "time field" and the second parameter is provided the required minutes to Subtract.

    So, sub_time(12:00:00, 180) will result in the time field as 09:00:00.

  10.  today

    This function fetches the current date.
     
    For example, if you need to update the Payment Received date when an invoice Status is changed to Paid, For this, you must use the function get_date('today').



  11. tomorrow

    This function fetches the date of the next day.

    For example, if the Status of a project is changed to Initiated on the current day, then the Start Date of the project should be updated with tomorrow’s date. So, the expression would be get_date('tomorrow').



  12. Yesterday

    This function fetches the date of the previous day.

    For example, if you need to update the previous date of the scheduled Webinars to send out a reminder Email, For this, you must use the function get_date(‘yesterday’).



Was this article helpful?

Can't find what you're looking for? Submit Ticket