How to fix formula errors

How to fix the "Operator '+' cannot be applied to date and number" error

To fix it, you need to convert the number to a duration with the help of the Days function. If the number represents a month or a year, there is no way to convert it to a duration; you should adjust the formula expression to use the AdjustMonth or AdjustYear function accordingly.

For example:

If the number is constant, it’s possible to just add a "d" suffix at the end to convert it to a duration in days.

For example:

How to fix the "Operator '-' cannot be applied to date and number" error

To fix it, you need to convert the number to a duration with the help of the Days function. If the number represents a month or a year, there is no way to convert it to a duration; you should adjust the formula expression to use the AdjustMonth or AdjustYear function accordingly.

For example:

If the number is constant, it’s possible to just add a "d" suffix at the end to convert it to a duration in days.

For example:

How to fix "Operator '+' can not be applied to timestamp and number" error

To fix it you need to convert number to duration with help of Days, Hours or Minutes function. If the number represents a month or a year, there is no way to convert it to a duration; you should adjust the formula expression to use the AdjustMonth or AdjustYear function accordingly.

For example:

If number is constant it’s possible just add a "d", "h" or "m" suffix at the end to convert it to duration in days, hours or minutes.

For example:

How to fix "Operator '-' can not be applied to timestamp and number" error

To fix it you need to convert number to duration with help of Days, Hours or Minutes function. If the number represents a month or a year, there is no way to convert it to a duration; you should adjust the formula expression to use the AdjustMonth or AdjustYear function accordingly.

For example:

If number is constant it’s possible just add a "d", "h" or "m" suffix at the end to convert it to duration in days, hours or minutes.

For example:

How to fix "Expression expected to return text, found user" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To fix it you need to convert user to text with help of UserToName function.

For example:

How to fix "Operator '>=' can not be applied to timestamp and date" error

To fix it you need to convert timestamp to date with help of ToDate function.

For example:

If for timestamp is used Now function you can replace it with Today function which return current date, so there is no need to convert it value to date.

How to fix the "Operator '=' cannot be applied to user and text" error

If the text resembles an email address, you can convert it to a user with the help of the ToUser function. Otherwise, you need to convert the user to text using the UserToName function.

For example:

How to fix "Operator '=' can not be applied to bool and text" error

If text is constant string like "No" or "Yes" or "True" or "False" or "Y" or "N" then replace it with true or false boolean constant accordingly.

For example:

Otherwise you’ve need to convert bool to text or convert text to bool.

How to fix "Expression expected to return number, found duration" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To fix it you need to convert duration to number with help of ToDays, ToHours, ToMinutes or ToSeconds function depending on which value you need.

For example:

How to fix "Function 'If': argument" error

If function should return one type of value.

How to fix "Function 'Case': argument" error

Case function should return one type of value.

How to fix "Column not found" error

To fix it, you should ask the user to replace the not found column name with an existing table column. You can also offer possible options if any.

How to fix "Operator '=' can not be applied to bool and number" error

If number is constant number like "1" or "0" then replace it with true or false boolean constant accordingly.

For example:

Otherwise you’ve need to convert number to bool with help of ToBoolean function:

How to fix "If/Case expressions nested too deep" error

To fix it, you should replace multiple nested If functions:

If(condition1, result1, If(condition2, result2, If(conditionN, resultN, else-result)))

with a single "If" function containing multiple condition-result pairs:

If(condition1, result1, condition2, result2, conditionN, resultN, else-result)

For example, the following formula with nested "If" function:

If([Status]="Paid", [Paid Date], If([Due Date]>Today(), [Due Date], Today()))

can be replaced with the following formula:

If([Status]="Paid", [Paid Date], [Due Date]>Today(), [Due Date], Today())

How to fix "Columns are not allowed in this context" error

The error "Columns are not allowed in this context" occurs when there is no current table record during formula calculation, preventing the use of any table column in that formula. To resolve this issue, you need to reconsider and rewrite your formula without using any table columns.

How to fix "Expected text" error

To fix it, use the Format function to convert a value to text. If a column reference is provided, TeamDesk derives formatting options from the column properties. Additionally, the Format function respects user-specific locale settings and supports a variety of standard and custom formatting patterns.

How to fix "Expression expected to return time, found date" error

There is no way to convert date to time. To resolve this issue, you need to reconsider and rewrite your formula.

How to fix "Expression expected to return duration, found number" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To fix this error, you need to convert the number to a duration using the Days, Hours, Minutes, or Seconds function, depending on which numeric value the formula calculates. If the formula calculates numeric values in years, then there is no way to convert it to a duration. In such a case, it may be possible that an incorrect formula type is being used. Please consider changing the column type from Formula-Duration to Formula-Numeric in that case.

How to fix "Function does not exist" error

Function names are case-sensitive, so first, check if the function is named correctly. Here is the list of available functions in alphabetical order:

Abs, AdjustMonth, AdjustYear, All, Any, AppId, Acos, Asin, Atan, BackURL, Between, Begins, Browser, Case, Ceil, ColumnId, Concat, Contains, Cos, Cot, Count, Date, Day, DayOfWeek, DayOfYear, DeviceLatitude, DeviceLocation, DeviceLongitude, DeviceTimestamp, Distance, Ends, Exists,Exp, FileName, FileType, FirstDayOfMonth, FirstDayOfPeriod, FirstDayOfQuarter, FirstDayOfWeek, FirstDayOfYear, Floor, Frac, Guid, HMAC, Hash, Hour, If, In, Int, IsLeapDay, IsLeapYear, IsNull, LastDayOfMonth, LastDayOfPeriod, LastDayOfQuarter, LastDayOfWeek, LastDayOfYear, Latitude, Len, List, Ln, Log, Longitude, Lower, Max, Mid, Min, Minute, Mod, MonthsBetween, NextDayOfWeek, NotLeft, NotRight, Now, Nz, Parameter, ParentKey, Pi, PrevDayOfWeek, Proper, PV, Radians, Random, RecordId, Rem, Replace, Response, ResponseHeader, ResponseStatus, Right, Role, Round, Sin, Sqrt, Second, Seconds, Sum,Tan, Time, Timestamp, ToBoolean, ToDate, ToDays, ToHours, ToLocation, ToMinutes, ToNumber, ToSeconds, ToText, ToTimeOfDay, ToTimestamp, Today, Trim, Upper, URL, URLDecode, URLEncode, URLParam, User, UserToEmail, UserToName, YearsBetween, Year.

How to fix "Expression expected to return number, found text" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To fix it, you need to convert the text to a number with the help of the ToNumber function.

For example:

If the text is a constant, you can simply convert it to the numeric literal. Numeric values should be written as is without the quotes. For example, 123.56.

How to fix "Operator '-' can not be applied to number and duration" error

To resolve this issue, you have two options:

  1. Convert the duration to a number using the ToDays, ToHours, ToMinutes, or ToSeconds function, depending on the desired value.
  2. Convert the number to a duration using the Days, Hours, Minutes, or Seconds function, depending on the desired value.

How to fix "Operator '-' can not be applied to number and text" error

To resolve this issue, you need to convert the text to a number using the ToNumber function.

For example:

How to fix "FileName() is not allowed in this context" error

This function can only be used in the Call-URL action body section.

To resolve this issue, you need to reconsider and rewrite your formula without using FileName function.

To obtain a file name from another location, please consider using the following formula:

Left([File Attachment Column], ";") - This formula returns a file name for the attachment stored in the "File Attachment Column".

How to fix "FileType() is not allowed in this context" error

This function can only be used in the Call-URL action body section.

To resolve this issue, you need to reconsider and rewrite your formula without using FileType function.

How to fix "Response() is not allowed in this context" error

This function can only be used in the Call-URL action or Webhooks.

To resolve this issue, you need to reconsider and rewrite your formula without using Response function.

How to fix "Expression expected to return time, found timestamp" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To resolve this issue, you need to convert the timestamp to a time using the ToTimeOfDay function.

For example:

ToTimeOfDay([Timestamp Column]) returns the time value from the timestamp.

How to fix the "Expression expected to return text, found number" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To resolve this issue, you need to convert the number to text using the Format or ToText function. If you need to convert a column value, use the Format function.

For example:

How to fix the "Expression expected to return text, found date" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To resolve this issue, you need to convert the date to text using the Format or ToText function. If you need to convert a column value, use the Format function.

For example:

How to fix the "Expression expected to return text, found time" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To resolve this issue, you need to convert the time to text using the Format or ToText function. If you need to convert a column value, use the Format function.

For example:

How to fix the "Expression expected to return text, found timestamp" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To resolve this issue, you need to convert the timestamp to text using the Format or ToText function. If you need to convert a column value, use the Format function.

For example:

How to fix the "Expression expected to return text, found duration" error

If an error occurs at position 0, then the entire formula is correct, but it returns the wrong type. So, you have to change the type for the entire formula.

To resolve this issue, you need to convert the duration to text using the Format or ToText function. If you need to convert a column value, use the Format function.

For example: