Pregunta

I'm working on SharePoint Online (new excperiance) and I've created a document library at the Site Content Types. For that type I'll have a column with auto increments and starting with TN. For this I create a column type of Calculated (calculation based on other columns).

At the Additional Column Settings, I'm using this formula

= "TN" & [ID]

and The data type returned from this formula is: Single line of text.

But when I save, I've got next error:

Sorry, something went wrong: The formula refers to a column that does not exist. Check the formula for spelling mistakes or change the non-existing column to an existing column.

I've added a hidden column ID to the list.

Did I something wrong? I've seen on this Stack Overflow question that my formula is correct.

¿Fue útil?

Solución

Using SharePoint default ID column in the calculated columns is not good option because ID will created after item added successfully in the list.

Even thought ID column is not in the list of "Insert Column" fields while creating formula, IDs can work in calculated columns just by writing [ID] in formula. But, they are unreliable as the calculated column will get updated only if the item is edited/changed.

Solution:

Use Workflow : If you need to use the ID column in a calculation, the best approach is to do the calculation in a workflow and set a column to the value returned by the calculation.

Licenciado bajo: CC-BY-SA con atribución
scroll top