none
Question regarding infopath document id

    Question

  • Is there any other way to put unique Id on InfoPath form except this one?

    http://www.bizsupportonline.net/browserforms/autonumber-infopath-form-submitted-sharepoint-library.htm

    I know that we have document id service enabled as a site collection feature, so is it possible to use it inside InfoPath forums?


    bostjanc

    Wednesday, January 11, 2017 10:05 PM

Answers

  • Hi Bostjan,

    We can add another hidden field and rules to set the custom document id field in the InfoPath form.

    The first rule will set the hidden field with “max(ID) +1”, and then the second rule will check the value of the hidden field. If the hidden field is equal to NaN, then set the custom document id field to 1; if the hidden field is not equal to Nan, then set the custom document id field to “max(ID) + 1”.

    You can use count() function in rules to count the items in the Form library, if the count() is equal to 0, then you can set the custom document id to 1.

    Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, January 16, 2017 2:08 PM
    Moderator

All replies

  • Hi,

    Can you please check this

    https://3dcios-web.sharepoint.com/delong/Lists/Posts/Post.aspx?ID=8

    https://sharepointryan.com/2011/05/25/add-an-auto-numbering-field-to-an-infopath-form/


    Please remember to click Mark as Answer on the answer if it helps you

    Wednesday, January 11, 2017 10:16 PM
  • Thanks.

    One more additional question:

    * how to achieve if there are none forms in library yet that field does not show NaN at the begining?

    * is there a way to reset ID number? We have created and deleted a lot of items, now the number of first form in the library does not equals 1?

    with best regards


    bostjanc

    Thursday, January 12, 2017 9:43 AM
  • Hi Bostjan,

    We can add another hidden field and rules to set the custom document id field in the InfoPath form.

    The first rule will set the hidden field with “max(ID) +1”, and then the second rule will check the value of the hidden field. If the hidden field is equal to NaN, then set the custom document id field to 1; if the hidden field is not equal to Nan, then set the custom document id field to “max(ID) + 1”.

    You can use count() function in rules to count the items in the Form library, if the count() is equal to 0, then you can set the custom document id to 1.

    Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, January 16, 2017 2:08 PM
    Moderator
  • Hi Bostjan,

    Did my solution work for you?

    Best Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, January 31, 2017 9:42 AM
    Moderator