SharePoint: calculated column values ​​disappear when you edit a list item. Any ideas?

I have a calculated column in a SharePoint 2007 user list with the following formula:

=CONCATENATE("IR-",[ID],"-",LEFT(UPPER([Title]),25)) 

If an item is created in the list, everything will be fine, however, when the item is updated, the [ID] column is no longer in the calculated column for this item.

So, when creating: "IR-40-TheTitleIsHere", but after editing it is "IR - TheTitleIsHere".

Anyone have any idea why this is happening?

+4
source share
4 answers

I confirm the behavior described above. Any addition / editing will destroy the [ID] part. If you edit a column in the list and update the formula, it will update ALL elements of the list so that they are correct (until you do the editing on the element).

I found this post that mentions the same issue .

It seems like the only solution is to make a simple workflow using SharePoint Designer, which will update the text box in your list.

+4
source

I had a problem again. Through other blogs and experts, I found that the [ID] column should not be used in a computed column because it causes chaos and causes a lot of errors. Sorry - delete the id column and everything will be fine.

+1
source

This question is a bit old, but I had the same problem and I found a solution for it. This is a rather specific fix and will not help everyone - it includes the use of javascript in the content editor web part to update the calculated field.

This site - http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/ - gives an example of how to use javascript in the same way as I used it. An important block of code is the first while loop. The point is to grab the field identifier from the list from the list and update any calculated field that must match the identifier.

In my case, I had a URL in the computed field that required an identifier as a parameter .. Of course, this does not work fine because you cannot put the identifier in the computed field. What I did, I put "ID = null" in the ID parameter of my calculated url field, then I replaced it with the identifier that was obtained using javascript .. so whenever the page loads, js starts up and updates all the urls addresses to have the correct identifier.

+1
source

I know this is very old, but I could not find a newer version of the question anywhere else, and the answer above from ferr solved the problem for me, but is not very clear, so I thought I was updating it.

It is assumed that you want to use the ID in the output HTML (for example, inside a link), I think this is quite common.

Using javascript from the pathtosharepoint link, I added the following to get an identifier with an if statement for security:

 if (HTMLregexp.test(CellContent)) { //original pathtosharepoint line if (NodeSet[i].parentNode.getAttribute("iid")){ var SPID = NodeSet[i].parentNode.getAttribute("iid").split(",")[1]; CellContent = CellContent.replace("SPIDReplace", SPID) } NodeSet[i].innerHTML = CellContent; //original pathtosharepoint line 

This is placed in the while loop of the last pathtosharepoint fix at the time of writing. This works for me in SharePoint 2010. Note: Include the string "SPIDReplace" in the computed column to replace it with the element identifier.

pathtosharepoint page: http://blog.pathtosharepoint.com/category/calculated-columns/ pathtosharepoint code: http://pathtosharepoint.com/Downloads

0
source

All Articles