5

I'm using SharePoint 2013 and I have a calculated column in a custom list, called "Project ID" that has the following calculation:

="DS-000"&ID

The first item in the list has the "Project ID": DS-0001

When I make any changes to that record, the "Project ID" changes to: DS-000 Yet if I show the ID column, I can still see that it says "1". The only way to get the value back is to edit the "Project ID", change nothing, then click "OK". Once I do that, the ID number is back.

Any way to make that column retain the ID number after a change?

One caveat, I cannot use SharePoint Designer.

Many thanks in advance.

1 Answer 1

2

ID is not valid column to use in Calculated Formulas, it is not displayed in the available columns for a reason.

  • It is 0 for newly created items as it gets its value from the database after all Formulas are evaluated

  • You get the correct values (in all existing items) if you re-edit the Formula

  • It is reset to 0 on Item update (I never investigated why)

Only way is to get hold of that ID in a Workflow and save it to another Column

If you really can not use Designer.. kinda like driving a Tesla, and not being allowed to use a charger
You need a CSR or other Script that checks for 0 values in that Calculated Formula, gets the correct ID and writes it back... it is going to be duc-tape..

You can get the ID in the View in JavaScript: Get clicked item ID from list

Update #1

If you can not use a workflow to get ID into a separate field your other option is to use a Client Side Script which checks for invalid=0 ID and updates your own field.
Major drawback is this script will not run immediatly for every item( like a Workflow can) but has to be triggered somehow.

  • You can trigger by hand (code in a CEWP)
  • You can trigger in a View (code in CSR or Calculated Column)

Second option can be 'instant' as from a New Form you (normally) end up in the Default View of the List.

iCSR iCC

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.