Error: Failed to insert child node - InfoPath Dev
in

InfoPath Dev

Error: Failed to insert child node

Last post 06-01-2012 11:22 AM by Hilary Stoupa. 17 replies.
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts: Previous Next
  • 06-01-2012 06:41 AM

    Error: Failed to insert child node

    I am getting the subject error when i use concat("Insert /parent=/my:myFields /child=my:Metrics/my:Metric /count=", xdXDocument:GetDOM("ViewOptions")/Util/fields/Count). My count field shows 3, which is correct. I have attached a screen shot of my main data schema. could someone please tell me what i might be doing wrong.

    TIA
    Dean


    Dean
    Charlotte, NC
  • 06-01-2012 07:34 AM In reply to

    Re: Error: Failed to insert child node

    Hi Dean,

    The Insert command allows insertion of rows in a repeating table. I see your /child path is my:Metrics/my:Metric, which isn't a repeating node. My first guess is that's the reason why the command is failing.

    Are you trying to insert  my:Metric or a row in the repeating my:Metrics?

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-01-2012 07:51 AM In reply to

    Re: Error: Failed to insert child node

    I am trying to insert multiple rows, I get the same error when i use concat("Insert /parent=/my:myFields /child=my:Metrics /count=", xdXDocument:GetDOM("ViewOptions")/Util/fields/Count)

    Some additional info, this is on a form that has several dropdowns that are being used to help the user choose the right item. The user is supposed to be able to choose a plan which contains several metrics (the items that should popluate the repeating section. The user will then enter their data into a repeating table that is within the repeating section.


    Dean
    Charlotte, NC
  • 06-01-2012 08:44 AM In reply to

    Re: Error: Failed to insert child node

    Hi there - looks like you need to also include the /before param.

    Based on your schema screenshot, I'd think you'd use:

     concat("Insert /parent=/my:myFields /child=my:Metrics /before=my:SelfAssessment /count=", xdXDocument:GetDOM("ViewOptions")/Util/fields/Count)

    Can you give that a try?

    Hilary Stoupa

  • 06-01-2012 09:27 AM In reply to

    Re: Error: Failed to insert child node

    THANK YOU, i read the documentation, but since it was optional, i did not realize that it was needed in my scenario. It might help others to expand on this topic in the documentation.

    I am able to insert the correct the number of items in the repeating section, but they are the wrong items. I need to apply a filter to the, i think to my Insert row rule, but i'm not sure how do this. Could you please point me to an example?

    Thanks

    Dean

    Dean
    Charlotte, NC
  • 06-01-2012 09:32 AM In reply to

    Re: Error: Failed to insert child node

    Can you help me understand what this means:

    dlgross:
    I am able to insert the correct the number of items in the repeating section, but they are the wrong items.

    Aren't you just inserting 3 rows? Is the problem when you try to populate the data in the rows you are inserting?

    Hilary Stoupa

  • 06-01-2012 10:12 AM In reply to

    Re: Error: Failed to insert child node

    In the Copy Sharepoint List Values to InfoPath Repeating section fields document, you are getting ALL of the people in the contacts list. In my case, I am populating a repeating section that is effectively a subform so i only want to get a subset of the items in my SP List. I have 2 secondary data connections to SP lists, that are in a 1 to many hierarchy

    I added a filter (using an Id value from main form) to the Count rule which is returning the correct number of items from my list (which can vary from 1 to 5 or 6). When i do the insert, i am getting the first items in my list instead of the specific items that i need.The Insert Row command seems to be creating the empty rows that are then populated by the Set values statents for each field, I think that i need to add an additional filter to the set values statements in the repeating section OR when the secondary connection is run

    Dean
    Charlotte, NC
  • 06-01-2012 10:26 AM In reply to

    Re: Error: Failed to insert child node

    I think you are right - that you need to either filter the data being returned (not sure what is providing your secondary data, so I can't really speak to that) or you need to use an additional filter when you are setting the value - like group/repeatingGroup[ID = 1][1]/field to get a field value from the first instance of your repeating group where the ID is equal to one... does that make sense?

    Hilary Stoupa

  • 06-01-2012 10:33 AM In reply to

    Re: Error: Failed to insert child node

    My secondary data is coming from a SP list via GetMetrics.  this queries the Metrics list that has a lookup column from the Synopsis list.

    in the Set ID rule of the repeating section, I'm trying xdXDocument:GetDOM("GetMetrics")/dfs:myFields/dfs:dataFields/dfs:Metrics[@SynopsisID = xdXDocument:get-DOM()/my:myFields/my:synopsisID]/@ID which is getting me closer, but now i getting same data in each of the repeating sections. The SynopsisID is the value from the main form that i am using to filter the items

    Dean
    Charlotte, NC
  • 06-01-2012 10:39 AM In reply to

    Re: Error: Failed to insert child node

    Are you using SharePoint 2010? If so, can you use the query fields to get back just the data you need?

    You'll still need to use some kind of counter to loop through the items - even if you are filtering on the SynopsisID - since the XPath you are using will only ever get the ID of the first Metrics node from your Metrics list.

    Hilary Stoupa

  • 06-01-2012 10:43 AM In reply to

    Re: Error: Failed to insert child node

    Yes, i'm using SP 2010, what do you mean
    Hilary Stoupa:
    can you use the query fields to get back just the data you need
    Dean
    Charlotte, NC
  • 06-01-2012 10:47 AM In reply to

    Re: Error: Failed to insert child node

    If you look at the fields task pane for your SharePoint List data connection - do you see the Query fields? Are you using IP 2010 as well? You can use those for equivalency queries - set the SynopsisID query field to the form's SynopsisID and then execute the query to return only the rows that match.

    Hilary Stoupa

  • 06-01-2012 10:52 AM In reply to

    Re: Error: Failed to insert child node

    I'm using IP 2010, but my form is set to IP 2007 Form Filler template because that is what my users have. When I look at the GetMetrics (Secondary) connnection, i just see a dataFields node under the myFields node, Did i miss something when i created this connection?

    Dean
    Charlotte, NC
  • 06-01-2012 10:57 AM In reply to

    Re: Error: Failed to insert child node

    Nope - it is because your form is IP 2007 - it would need to be 2010 to have the query fields.

    Hilary Stoupa

  • 06-01-2012 11:03 AM In reply to

    Re: Error: Failed to insert child node

    ok, so back to my earlier problem, how to apply a filter and step through the filtered results for each section in the repeating section. can this even be done?

    Dean
    Charlotte, NC
Page 1 of 2 (18 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.