1

I want to add an additional ID column and it should begin from 1.

for this, i write a code to calculated column like this;

=IF([ID]>200;[ID]-200;"OLD ID")

this works fine, but when i add a new item, "if condition" returns negative value automatically.

in the calculated value field, i can see the my own formula but changed and brackets gone.

  • Are you inserting ID field manually, right? What do you mean with "changed formula"? I've tested your IF formula in a SP 2013 list and trying to add new item with ID<=200 it returns "OLD ID" otherwise it returns ID-200, so it seems working. – Pepozzo Jan 16 '14 at 13:44
  • yes i insert it manually. formula looks like "IF(ID>200;ID-200;"OLD ID")". i want that, if ID bigger than 200 then ID2(my new additional id column.) shows the id2 number with beginning number 1. – AhuraMazda Jan 16 '14 at 13:51
  • 1
    Ok, it's normal that SP converts squadre brackets. I can't understand what you exactly want. If your need is the ID2 should have the starting digit as 1 or if you want to subtract 200 to ID field. Anyway, if your need is the second one, your formula seems right, otherwise the formula should be: =IF(ID>200;"1"&ID;"OLD ID") – Pepozzo Jan 16 '14 at 14:02
  • thanks, i want to do second one. i want to substract 200 from ID number. althought formula works for the old items, new items cannot take the formula correctly. this is because of that formula changes and brackets gone. – AhuraMazda Jan 16 '14 at 14:28
  • And if you try to modify an existent item? However I've tried to add a new item with your formula (and even with ID column as text or number) and it works fine. Could you please attach a screenshot of your problem? Thanks PS: here's my test results imgur.com/fgfkogc – Pepozzo Jan 16 '14 at 15:09
1

after a little bit more search, i see that, problem is not related with brackets. it is because of ID column spesification. ID column is not generated first but last. so it is not possible to manipulate it with calculated column.

there is two different way i see.

first one using workflow

second one item event receiver. here is the link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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