locked
Pretend form creation in SP 2013 RRS feed

  • Question

  • Hello,


    I am trying to assign automatic names with custom format when the form is created. (I don't want our users to enter the name of the form)

    I am using the XPath in submit Data Connection:

    The idea is to predict new ID (take max of existing ID and add 1) and append with constant string to get name of the form "Student Number = 12".

    Is there a way to pretend the item creation, so we can get the actual Id that the form is going to be assigned? Lets say we deleted the last form from the library. The next form will have max+2 (instead of max+1). In other words, is there a way to get the increment pointer?



    - a citizen of Microsoft Developer Network.

    • Edited by Real McCoy Thursday, August 1, 2013 10:50 AM
    Wednesday, July 31, 2013 5:29 PM

Answers

  • Hi,

    To get the being created item ID in a library, we can:

    1. Save ID of the latest created item in a filed in an item in a new list.
    2. Update the field’s value by workflow, set the value as the ID of the created item. The workflow is started when an item is created.

    We can follow these steps to achieve the goal:

    1. Create a field in a new list, and set the first value to be 1.
    2. Create a workflow associated with the library, and update the value of the field in step1 to be the ID of current item in the library.
    3. Modify the workflow by selecting start workflow automatically when an item is created.
    4. Add the list in step1 to InfoPath as the external data.
    5. Modify the submit option of form name by getting the value of the field in step1 to append with the constant string.

    Best regards.

    Thanks



    • Edited by Victoria Xia Sunday, August 4, 2013 11:28 AM
    • Marked as answer by star.wars Wednesday, August 7, 2013 12:27 PM
    Sunday, August 4, 2013 11:27 AM

All replies

  • Hi,

    To get the being created item ID in a library, we can:

    1. Save ID of the latest created item in a filed in an item in a new list.
    2. Update the field’s value by workflow, set the value as the ID of the created item. The workflow is started when an item is created.

    We can follow these steps to achieve the goal:

    1. Create a field in a new list, and set the first value to be 1.
    2. Create a workflow associated with the library, and update the value of the field in step1 to be the ID of current item in the library.
    3. Modify the workflow by selecting start workflow automatically when an item is created.
    4. Add the list in step1 to InfoPath as the external data.
    5. Modify the submit option of form name by getting the value of the field in step1 to append with the constant string.

    Best regards.

    Thanks



    • Edited by Victoria Xia Sunday, August 4, 2013 11:28 AM
    • Marked as answer by star.wars Wednesday, August 7, 2013 12:27 PM
    Sunday, August 4, 2013 11:27 AM
  • It is not possible to get the ID of the item being created.

    If you have an active list, with several inserts together, you will run into concurrency issues.

    It would be best to use a calculated column. You can use an ID in a calculated column, although it is not directly visible.

    Sunday, August 4, 2013 11:55 AM