Automatic count - InfoPath Dev
in

InfoPath Dev

Automatic count

Last post 08-26-2019 04:18 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-26-2019 07:26 AM

    • Hordec
    • Not Ranked
    • Joined on 08-23-2019
    • Posts 1

    Automatic count

    Hello, I am quite a newbie using InfoPath and I am having a hard time trying to turn my wishes into reality. I am creating a form and I would like to include an ID for each entry that would depend on the following: - First a fix part that depends from several entries of the form. Let's say the fix part is XXXXX. I was able to generate this fixed part with concat formula mainly so this is ok - Then a variable part, depending on the XXXXX combination. The variable part is numerical and should appears with three digits. Thys, if the list already contains 3 entries containing the XXXXX combination, the variable part should be 003. Another example would be the first time the combination XYXYX appears in the entries of the list, the variable part would be 001. Then I would use concat to merge both parts and have a unique ID XXXXX001. Could anyone please help me in knowing how to generate the variable part? Thank you so much!
  • 08-26-2019 04:18 PM In reply to

    So - I generally don't recommend this, because unless you get really fancy you always a chance that two users will get the same number. However, if you must, here's how I'd do it. I'd keep the XYXYX data in its own field and promote that, so I can query on just that piece. Add a data connection to the library that includes the XYXYX field. Don't run the query on load. On your submit rules, if the form name is blank (just add a formname field to your data source, use it in your submit connection as the name of the form), set the XYXYX query field to the XYXYX value in the current form. Execute the query. Then use the count function to find out how many rows are returned. If you search this forum for zero padding, you should find posts explaining that part. :)
    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.