"Coding for future" is about sharing all the small small solutions that may occur to you as you code. As sharing code & solutions save developer's time, it will eventually lead to faster and cost effective software development and also to an effective future.
I got following question from Chris Polek who happen to stumble upon my blog. I tried to answer it best of my knowledge but I am sure there can be multiple ways to achieve this. If you find a better solution, do comment!
I would like to create a column in a custom list that will sequentially assign the number 1, 2 or 3 to an item created in the list. After assigning a ’3′, it will start over at ’1′. Optionally, this could be a name as well, but a number will work just fine.
Would you be able to help me with this request?
Interesting! You can do this by using a calculated column or by using a workflow.
Calculated column method:
You can base your logic with the help of ID column.
For e.g. If the id of the list item is 3 or 6 or 9 or if the sum of the digits is 3/6/9 then put the column value as 3
For e.g. If id =12 then 1+2= 3 hence you will print 3
If all above is false then if the id is even number then print 2 else print 1
If above logic seems complicated then try this Workflow method:
Create another list, create one list item where Title = 1
Now on your original list write a workflow which will read this value and print in your custom column. Once this is done the workflow will also increment the value into another list by one or reset it to one if it has reached to 3
I hate waking up early on weekends, but even after disabling alarms I still end up waking up the same time! So I decided to put this time to help others by blogging things that I learnt throughout the week.
This week I met Parag, and he has a really effective concept of learning technologies. He has a website called as “Do It Yourself Computer Science” where one can learn the technology with his own pace and then interact socially using twitter with others who are too learning the same course at that time. This happens by forming online study groups. This concept is called as Flipping the classroom which is a revolutionary concept that can replace the conventional classrooms. Watch this TED video about what flipping the classroom means.