2

How can I automatically add a value to a column when making a new list item?


Like, if I make a new item in a list named "Announcements", and I want the "Expires" column to automatically get a date 3 months later than today's date, how would I do that? Or is this simply not possible?

Should I do this with a calculated column? Like, based on the date a list item was created/posted, extract that date and add 3 months?

Sorry for all these questions; I just can't figure it out.

I am ok with OOTB solutions, as long as I can do it with jQuery or JavaScript or anything similar.

3 Answers 3

2

yes, you can do this with calculated column. Create one calculated column and set value as created date plus 3 months.

2
0

You can also use JQuery. Add a CEWP webpart to the page and add a script similar to this

$("input[tite='fieldName']").val("Value to prepopulate");

SOURCE

0

Actually, there is a more straight forward way to this. Just set the "Default Value" for the "Expired" column in the edit column page and set it to Today()+90

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.