Apr 01, 2020 06:26 AM
Hi Team,
I wants to insert the dynamic value through variable in formula.
eg: filterByFormula: “IS_AFTER({Time-stamp}, dateValue)”
Here dateValue is a variable that gives error. but if i use the string instead variable it works . Also variable is type of string . Please suggest the best way to insert the variable value in formula.
Solved! Go to Solution.
Apr 01, 2020 09:22 AM
To fix your formula, dateValue needs to be replaced with a value that is a datetime type. That could look like:
IS_AFTER({Time-stamp}, {Some Other Date Column})
Or if the value is the same for every row, you could use DATESTR (which converts a properly formatted string to datetime):
IS_AFTER({Time-stamp}, DATESTR("2015-11-12"))
Also it seems odd to me to see the words variable and formula in the same sentence. I’m tempted to say formulas don’t have variables, but I suppose a {column name} is a variable since it’s a dynamic value. But I can’t, for example, pick a word that only exists in a formula and assign it a value (as a language like JavaScript would allow).
Apr 01, 2020 09:22 AM
To fix your formula, dateValue needs to be replaced with a value that is a datetime type. That could look like:
IS_AFTER({Time-stamp}, {Some Other Date Column})
Or if the value is the same for every row, you could use DATESTR (which converts a properly formatted string to datetime):
IS_AFTER({Time-stamp}, DATESTR("2015-11-12"))
Also it seems odd to me to see the words variable and formula in the same sentence. I’m tempted to say formulas don’t have variables, but I suppose a {column name} is a variable since it’s a dynamic value. But I can’t, for example, pick a word that only exists in a formula and assign it a value (as a language like JavaScript would allow).