Symptoms
When performing a migration, ShareGate Migrate displays the following error:
The formula of a calculated column cannot contain volatile functions like Today and Me.
Error code
- ST-007-154
- IN-178-154
- IN-178-154
- Error codes ending with: -154
Details
This error occurs when a calculated column is being migrated (either a site column or a list column) and its formula uses a volatile function like Today or Me. Theses functions cannot be directly set into the formula of a calculated column because SharePoint does not allow it. The reason behind this is that calculated column values are not updated every time they are viewed, but rather every time the item is updated. This means that the value for Today or Me will not always be up-to-date for the person who looks at the values, so SharePoint prevents their usage to avoid confusion.
Solution
It is not recommended to use those volatile functions for calculated column formulas, so the best practice would be to update the formula of the source column to remove references to those functions before migrating, which will prevent the error entirely.
If you really need to use them, then there is a workaround that you can use to re-create the calculated columns with the same formulas at the destination. Basically, you can perform your migration with ShareGate Migrate and ignore the errors for the calculated columns. Once everything is copied except the calculated columns, you can use the following steps to manually create those calculated columns:
- Create a temporary column called "Today" or "Me".
- Create your calculated column with the formula that you need.
- Delete the temporary column you created (Today or Me).