NaN shows up as the form name when the first form is submitted - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

NaN shows up as the form name when the first form is submitted

Last post 03-04-2009 09:02 AM by Michael71. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 02-23-2009 10:17 AM

    • Michael71
    • Top 50 Contributor
      Male
    • Joined on 10-07-2006
    • Mclean, Virginia-USA
    • Posts 283

    NaN shows up as the form name when the first form is submitted

    How can I make the first form submitted not show NaN in the form name?

  • 02-23-2009 05:40 PM In reply to

    Re: NaN shows up as the form name when the first form is submitted

    HI -- can you explain more about what you are doing? Is the form name currently a formula that isn't calulating for some reason?

    Hilary Stoupa

  • 02-24-2009 06:34 AM In reply to

    • Michael71
    • Top 50 Contributor
      Male
    • Joined on 10-07-2006
    • Mclean, Virginia-USA
    • Posts 283

    Re: NaN shows up as the form name when the first form is submitted

     

    It's calculating, but the first item in the Library is always IPNaNW7. The NaN part of the Calculation is come from the Library, but because there isn't any forms in the Library the first form is always NaN. I just set up a secondary data source to the SharePoint Library.
  • 02-24-2009 06:12 PM In reply to

    Re: NaN shows up as the form name when the first form is submitted

    Oh, I see, because there isn't a value in the secondary data connection to the library the for the first form to use. Is this a default value? Or is set by a rule? I suppose you could add an open rule to set the name to IP1W7, or whatever you want in place of NaN, but then you run into the issue of two users opening forms while there are none in the library, then one submits and the other has an invalid number....

    You can actually create a default that is conditional. It is a little bit of a scary formula, but once you get used to it, it is a great tool. Here's a link to the InfoPath Team blog post on this approach. You'll want to take the second method mentioned. The boolean condition would need to check if there is a value in the id node returned by the SharePoint Library data connection. Give it a try, and post back if you get stuck, okay?

    Hilary Stoupa

  • 02-25-2009 06:40 AM In reply to

    • Michael71
    • Top 50 Contributor
      Male
    • Joined on 10-07-2006
    • Mclean, Virginia-USA
    • Posts 283

    Re: NaN shows up as the form name when the first form is submitted

    Hilary,

    You are a great help. I don't understand the formula. What I'm trying to do is set the ID to 1 if there is no forms in the Forms Library, so my concat("I", "P", max(@ID) + 1, substring(DisplayName, 1, 1), substring(AgentSSN, 1, 1))  can work properly. for my data connection and submit. I set up a bollean field element called IDEmpty and set the value to false. The condition on this field states: If ID is Blank

                                                  Set a field's value @ID= 1

    Don't think this is working.

    The formula for the example is long and confusing.  

     

  • 02-25-2009 04:50 PM In reply to

    Re: NaN shows up as the form name when the first form is submitted

    The example is long and confusing, I know. When you say 'The condition on this field' do you mean you have rule set on IDEmpty? If so, you need to have another rule that changes IDEmpty -- rules only fire if the field the rule is set on changes. You could have an open rule (Tools / Form Options / Open / Rules) that sets IDEmpty to true if the count of rows returned from your ShP connection is 0.....

    Hilary Stoupa

  • 03-02-2009 11:06 AM In reply to

    • Michael71
    • Top 50 Contributor
      Male
    • Joined on 10-07-2006
    • Mclean, Virginia-USA
    • Posts 283

    Re: NaN shows up as the form name when the first form is submitted

    Hillary can you give me a step by step process, because I'm very confused. I don't know where to start.

  • 03-02-2009 08:44 PM In reply to

    Re: NaN shows up as the form name when the first form is submitted

    Let's see. Some things will change depending on the name of you data connection, data structure, etc.

    1. Go to Tools / Form Options
    2. Under the Open and Save section, select the Rules button
    3. Add a new rule
    4. For condition, navigate to your Id field from your SharePoint data connection in the first drop down
    5. Set the second dropdown to 'is not present'
    6. For the action, set IDEmpty to true (use the formula editor and select the true() function from functions)

    This means that when the form opens, if there are no ID nodes from your SharePoint list, IDEmpty (which defaults to false) gets set to true. When it gets set to true, the rule on it fires, setting the form's ID field to 1. Does that help?

    Hilary Stoupa

  • 03-03-2009 09:53 AM In reply to

    • Michael71
    • Top 50 Contributor
      Male
    • Joined on 10-07-2006
    • Mclean, Virginia-USA
    • Posts 283

    Re: NaN shows up as the form name when the first form is submitted

     

    Hilary,

     

    Where in the steps above does it tells the form to submit to the ducoment Library and if there are no forms, make @ID =1 or increment where it left off?

  • 03-03-2009 12:59 PM In reply to

    Re: NaN shows up as the form name when the first form is submitted

    I was simply giving you the steps to set the Id field to 1 if there were no rows returned from your SharePoint list. I had assumed from your earlier posts that you already had your submit rules set up... you can extend the steps I posted by setting a second rule to set the Id field to the Max(Id from ShP list) + 1 if the Id from the ShP list is present. Then use the Id field in your formula for the name of the form, and handle your submit however you were already handling it....

    Hilary Stoupa

  • 03-04-2009 09:02 AM In reply to

    • Michael71
    • Top 50 Contributor
      Male
    • Joined on 10-07-2006
    • Mclean, Virginia-USA
    • Posts 283

    Re: NaN shows up as the form name when the first form is submitted

    Okay,  If the steps above sets the ID to 1 if the Library is empty, that should take care of my problem.

     

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