none
How to format conditional statements?

    Question

  • I am trying to use a formula in Infopath 2013 to accomplish the following (btw I'm a IP noob)

        Set the autonumber field equal to 1 when count(@ID) = 0
        Set the autonumber field equal to max(@ID) + 1 when count(@ID) > 0

    To me it would seem like a simple if/than statement but that's not one of the options in the "Insert Function" dialog box.

    Thanks.
    Friday, February 03, 2017 9:55 AM

Answers

  • Hi,

    You can create another field for storing the value of “count(@ID)” as below:

    Then you can use rules to set the autonumber field:

    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

    • Marked as answer by enegron68 Wednesday, February 08, 2017 12:23 AM
    Monday, February 06, 2017 8:28 AM
    Moderator

All replies

  • Hi enegron- why not do that in a calculated column in the list instead of IP? You could then use that field/value in IP for whatever you want.

    cameron rautmann

    Friday, February 03, 2017 2:32 PM
  • Hi,

    You can create another field for storing the value of “count(@ID)” as below:

    Then you can use rules to set the autonumber field:

    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

    • Marked as answer by enegron68 Wednesday, February 08, 2017 12:23 AM
    Monday, February 06, 2017 8:28 AM
    Moderator