1

Is there a way to give a field a value based on the value of the last entry made in the same Sharepoint list? For example, the last made item in a list has a Title-value of 'Subject123'. What I want is that when I make a new record, he automatically fills in the Title with the value 'Subject123', and with the option to change it manually.

A calculated fields can only be calculated with fields from it's own row, but maybe there's another way that I don't know of.

  • You might get an idea of different ways here: sharepoint.stackexchange.com/questions/153383/…, or here: sharepoint.stackexchange.com/questions/17339/… – Patrick Oct 31 '16 at 12:48
  • you can do that with infopath easily. Add current list as Data Connection to get last item field value. – Yavuz Oct 31 '16 at 14:28
  • 1
    @Yavuz I'm very interested how to do that with InfoPath. I was able to make a Data Connection in IP to the SharePoint List. But how can I get the latest value for the title-field? I guess I have to make a rule on the title field, with the type 'Set a field's value', but what do I fill in further? – J. Steenvoorde Oct 31 '16 at 15:03
0

Hi i will basicly explain with infopath. We will get list item field which ID equals dataconnection list's max ID.

  1. Add current list as data connection to receive list (select desired fields)
  2. Set desired field default value enter image description here

-> fx -> insert field or Group -> Show Advanced View -> Choose Added Data Connection (Secondary) -> dataFields -> choose desired field -> Filter Data -> Add -> Select desired field ID is equal to [use formula insert function max(ID)] -> in the end dafault value sholud look like TestField[ID = max(ID)]

  • Wow, thanks! That was what I needed. Thank you very much for your help. – J. Steenvoorde Nov 1 '16 at 11:22
0

You can not do this out of the box. You need to perform the following steps:

  1. Edit page NewForm.aspx
  2. Add a Content Editor Web Part
  3. Add code to get the latest title added. JSOM need. Below I detail a link to basic operations with JSON so you can take ideas.
  4. Then you can use jQuery to complete the default value in tittle field.

Complete basic operations using JavaScript library code in SharePoint 2013

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.