Submit nested repeating fields to Sharepoint List - InfoPath Dev
in

InfoPath Dev

Submit nested repeating fields to Sharepoint List

Last post 03-01-2011 01:01 PM by Hilary Stoupa. 37 replies.
Page 1 of 3 (38 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 02-06-2011 06:12 PM

    Submit nested repeating fields to Sharepoint List

    I am trying to write information from nested repeating sections and tables to a single sharepoint list.  Could you tell me how you would do this in the IP to SP List tool?  It appears to allow only one repeating section?  I tried it and it wrote successfully to my list, but only the top level repeating section...

    So then I made three different lists to receive the three levels or repeating sections, but could not figure out how to make the submit work, or keep the information linked up. I did three separate submits, but it did nothing.

    I would really prefer to have it all in one list.  I have attached the form and here is the mapping:

     <my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-11-27T15:29:00" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-us">
      <my:Mappings>
        <my:IsRepeating>true</my:IsRepeating>
        <my:RepeatingGroup>my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:grpLevelTwoItems/my:tblLevelTwoItems</my:RepeatingGroup>
        <my:Mapping>
          <my:FormField>my:LevelTwoItem</my:FormField>
          <my:SharePointColumn>Body</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>my:LevelTwoResp</my:FormField>
          <my:SharePointColumn>Sub_x0020_Task_x0020_Assign</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>my:LevelTwoPriority</my:FormField>
          <my:SharePointColumn>Sub_x0020_Task_x0020_Priority</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>my:LevelTwoStatus</my:FormField>
          <my:SharePointColumn>Sub_x0020_Task_x0020_Status</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>my:LevelTwoDueDate</my:FormField>
          <my:SharePointColumn>Sub_x0020_Task_x0020_Due</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>my:LevelTwoPercentComplete</my:FormField>
          <my:SharePointColumn>Sub_x0020_Task_x0020__x0025_</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:LevelOneItem</my:FormField>
          <my:SharePointColumn>Title</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:LevelOneAssign</my:FormField>
          <my:SharePointColumn>Task_x0020_Assign</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:LevelOnePriority</my:FormField>
          <my:SharePointColumn>Priority</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:LevelOneStatus</my:FormField>
          <my:SharePointColumn>Status</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:LevelOneDueDate</my:FormField>
          <my:SharePointColumn>DueDate</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:LevelOnePercent</my:FormField>
          <my:SharePointColumn>PercentComplete</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:Category</my:FormField>
          <my:SharePointColumn>_Category</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:ProjectName</my:FormField>
          <my:SharePointColumn>Project</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpProjectItems/my:Requestor</my:FormField>
          <my:SharePointColumn>Requestor</my:SharePointColumn>
        </my:Mapping>
        <my:Mapping>
          <my:FormField>/my:myFields/my:grpEmployeeInfo/my:ReptDate</my:FormField>
          <my:SharePointColumn>StartDate</my:SharePointColumn>
        </my:Mapping>
      </my:Mappings>
      <my:SharePointListURL>http://fulcoforms.co.fulton.ga.us/cff/project</my:SharePointListURL>
      <my:ListCollection>{087BC6F8-C28C-424A-BC0F-9C6FD1A5CB80}</my:ListCollection>
      <my:FullListURL>http://fulcoforms.co.fulton.ga.us/cff/project/Lists/Project</my:FullListURL>
      <Batch OnError="Continue">
        <Method ID="New" Cmd="New">
          <Field Name="Body">
          </Field>
          <Field Name="Sub_x0020_Task_x0020_Assign">
          </Field>
          <Field Name="Sub_x0020_Task_x0020_Priority">
          </Field>
          <Field Name="Sub_x0020_Task_x0020_Status">
          </Field>
          <Field Name="Sub_x0020_Task_x0020_Due">
          </Field>
          <Field Name="Sub_x0020_Task_x0020__x0025_">
          </Field>
          <Field Name="Title">
          </Field>
          <Field Name="Task_x0020_Assign">
          </Field>
          <Field Name="Priority">
          </Field>
          <Field Name="Status">
          </Field>
          <Field Name="DueDate">
          </Field>
          <Field Name="PercentComplete">
          </Field>
          <Field Name="_Category">
          </Field>
          <Field Name="Project">
          </Field>
          <Field Name="Requestor">
          </Field>
          <Field Name="StartDate">
          </Field>
        </Method>
      </Batch>
    </my:myFields>

  • 02-07-2011 02:51 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Hi:

    I may be misunderstanding what you need to do, here, so please correct me if I have. I think you are saying you need to map a repeating table to a list, and have other items at a higher level included. So, looking at your form, you want every level two item, and to include info from higher levels.

    The mapping tool can't handle for this currently -- you'll need to enter the relative XPath to your higher level items manually.

    However, your groups aren't really nested, are they? In the data source of your form, grpLevelTwoItems is NOT a child of tblLevelOneItems, which is where you have some of the fields you want to save to the same list. So, there could be 15 instances of tblLevelOneItems, and 15 instances of tblLevelTwoItems, and no way to know which LevelOneItem should be included with the LevelTwoItem being saved to the list -- does that make sense?

    If you want to submit to multiple lists, you'll need to add multiple submit connections, each one using the correct mapping file for the submit connection parameters. Then modify your qRules command to use the correct combination of mapping and submit connections.

    Hilary Stoupa

  • 02-07-2011 10:29 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Hi Donna,

    We're looking at adding nested mapping to the next version of qRules. I think it could be a big benefit but it might be too hard to do in the next month. More on that in a month. In the meantime, Hilary's suggestion to define multiple mappings should provide a workaround. If not, please send email to Support and somebody will respond.

    Thanks for your continued support,

    Patrick

    Patrick Halstead
    Project Manager at Qdabra
  • 02-08-2011 12:16 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    You have it exactly right...

    I did use the relative X Path in the tool, but as you point out, my Data Structure is not right...  So you are saying it should work if I alter the Data Structure?

    I will try changing the data structure and see what happens.  I have been swamped for the past couple of days...  Sorry for not getting back to you!

  • 02-20-2011 03:57 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Hi folks!!

     I am finally back on this monster...  I re-arranged the relationships in the form.  I then tried to just hook up the very last table fields with the list - just to get it working - and it is failing...

     I have attached the revised form.  Here is the other information I think you will need.

     

    LevelTwoMapping.xml  

    <my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-11-27T15:29:00" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-us">

      <my:Mappings>

        <my:IsRepeating>true</my:IsRepeating>

        <my:RepeatingGroup>my:myFields/my:grpEmployeeInfo/my:grpEmployee/my:grpProjectItems/my:grpLevelOneItems/my:tblLevelOneItems/my:grpLevelTwoItems/my:tblLevelTwoItems</my:RepeatingGroup>

        <my:Mapping>

          <my:FormField>my:LevelTwoItem</my:FormField>

          <my:SharePointColumn>Body</my:SharePointColumn>

        </my:Mapping>

        <my:Mapping>

          <my:FormField>my:LevelTwoResp</my:FormField>

          <my:SharePointColumn>Sub_x0020_Task_x0020_Assign</my:SharePointColumn>

        </my:Mapping>

        <my:Mapping>

          <my:FormField>my:LevelTwoPriority</my:FormField>

          <my:SharePointColumn>Sub_x0020_Task_x0020_Priority</my:SharePointColumn>

        </my:Mapping>

        <my:Mapping>

          <my:FormField>my:LevelTwoStatus</my:FormField>

          <my:SharePointColumn>Sub_x0020_Task_x0020_Status</my:SharePointColumn>

        </my:Mapping>

        <my:Mapping>

          <my:FormField>my:LevelTwoDueDate</my:FormField>

          <my:SharePointColumn>Sub_x0020_Task_x0020_Due</my:SharePointColumn>

        </my:Mapping>

        <my:Mapping>

          <my:FormField>my:LevelTwoPercentComplete</my:FormField>

          <my:SharePointColumn>Sub_x0020_Task_x0020__x0025_</my:SharePointColumn>

        </my:Mapping>

      </my:Mappings>

      <my:SharePointListURL>http://fulcoforms.co.fulton.ga.us/cff/Project</my:SharePointListURL>

      <my:ListCollection>{087BC6F8-C28C-424A-BC0F-9C6FD1A5CB80}</my:ListCollection>

      <my:FullListURL>http://fulcoforms.co.fulton.ga.us/cff/Project/Lists/Project</my:FullListURL>

      <Batch OnError="Continue">

        <Method ID="New" Cmd="New">

          <Field Name="Body">

          </Field>

          <Field Name="Sub_x0020_Task_x0020_Assign">

          </Field>

          <Field Name="Sub_x0020_Task_x0020_Priority">

          </Field>

          <Field Name="Sub_x0020_Task_x0020_Status">

          </Field>

          <Field Name="Sub_x0020_Task_x0020_Due">

          </Field>

          <Field Name="Sub_x0020_Task_x0020__x0025_">

          </Field>

        </Method>

      </Batch>

    </my:myFields>

     

       ERROR: 

     

  • 02-21-2011 09:32 AM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Hi:

    Was there an error when you tried to submit? Or the items just didn't appear in your list? What data type is the Sub Task Assign column in your SharePoint List?

    Hilary Stoupa

  • 02-21-2011 09:49 AM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    There was an error in the error field of the form that indicated the Sharepoint URL was {0}.  I thought I sent you a picture of that???  Maybe it did not go through.

    All of the fields in the Task List are Single line of text except for the obvious % fields (number) and date fields.

  • 02-21-2011 09:56 AM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Here is the exact error message - from the Error field of Qrules:

    An error has occurred executing the rule. Failed to submit to SharePoint. URL = '{0}'.

  • 02-21-2011 11:53 AM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Your submit data connection is not set up correctly. The listName parameter should use the mapping ListCollection node for its value (looks like the data connection is LevelTwoMapping). Try changing that and see what happens....

    Hilary Stoupa

  • 02-21-2011 12:32 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Oh my goodness, how stupid can I be?????

    Tell me, does it look like I managed - by some miracle - to nest my fields properly on the form this time? 

     I am so excited this works now!!!!  WOOOOOO  WOOOOOO!!!

    THANK YOU SOOOO MUCH!!!  I never would have seen that...

  • 02-21-2011 12:36 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    This command has a lot of moving parts. It is easier for me to find the issues because I've had to look for them a lot -- missing a single parameter certainly doesn't make you stupid. :-}

    Looking at your data source, everything seems to be properly nested -- you should be able to add to your LevelTwo mapping to include items from LevelOne and further up the tree, using the same relative XPaths that you were using earlier. Good job!

    Hilary Stoupa

  • 02-21-2011 01:01 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    I guess I woo woooed too soon...  I tried going to the next level and got this error?  I am so confused about the id field...

    An unexpected error occurred executing the rule. Action: SubmitToSharePointList Arguments: submit: ShPSubmit mapping: LevelTwoMapping id: my:id3 Details: Object reference not set to an instance of an object. Stack: at Qdabra.Tools.RulesLibrary.Commands.PopulateIdsAndLastModified(XPathNavigator outputNav, XmlDocument mapping, String idXpath) at Qdabra.Tools.RulesLibrary.Commands.SubmitToSharePointList(String submitDs, String mappingDs, String id, String dsname, String xpath, String name, String uniqueName) at Qdabra.Tools.RulesLibrary.Commands.SubmitToSharePointList() at Qdabra.Tools.RulesLibrary.Commands.ExecuteCommand()

  • 02-21-2011 01:23 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Can you attach your latest template?

    The /id parameter is an optional parameter. The value should be the relative XPath where you want the ID for the list item that is created in SharePoint returned -- this way when your existing XML is opened, you can update existing SharePoint list items rather than creating new.

    Hilary Stoupa

  • 02-21-2011 01:39 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    It hasn't changed much since last time you saw it, but certainly!!  I do have an id3 field in the root table.  That is what I specified???

    I didn't think I was confused, until I got the error....  Know what I mean???  HA HA!!

  • 02-21-2011 05:43 PM In reply to

    Re: Submit nested repeating fields to Sharepoint List

    Just to clarify, then, you are getting the above error when you run your Submit To All Tasks rule (with the command: SubmitToSharePointList /submit=ShPSubmit /mapping=LevelTwoMapping /id=@my:id3)?

    Your /id field does not appear to be an attribute, but in the copy of the form you attached, the command has the syntax: /id=@my:id3

    In your data source, the XPath is: my:id3

    What happens if you use the command:
    SubmitToSharePointList /submit=ShPSubmit /mapping=LevelTwoMapping /id=my:id3

    If I look at your other SharePoint submit rules, (the disabled ones) they also seem to have incorrect XPaths to their id nodes -- no namespace.

    But the error message you posted shows the /id node as NOT having the "@" before it in the command, which is why I'm confused. Had you changed the XPath to the id node in the command between posting that error and posting your template?

    Hilary Stoupa

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