Defining a Secondary InfoPath Data Source with CAML (XML) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Defining a Secondary InfoPath Data Source with CAML (XML)

Last post 06-20-2016 03:19 AM by Tunde Afolabi. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-09-2015 08:57 AM

    Defining a Secondary InfoPath Data Source with CAML (XML)

    I am creating an InfoPath form with repeating tables and teh best solution I've come across for submitting these data to SharePoint lists involves creatnig a secondary data source using a CAML file. The CAML code is:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Batch OnError="Continue">
      <Method ID="1" Cmd="New">
        <Field Name="Title" ></Field>
        <Field Name="Organization" ></Field>
        <Field Name="LService" ></Field>
        <Field Name="LRole" ></Field>
        <Field Name="FormID" ></Field>
      </Method>
    </Batch>

    However, when I go back to the Fields Pane and select the newly created Secondary Data Source (based on the CAML XML file), the field names are not shown. Instead, the field tree looks like:

    - (folder) Batch
       (Item) OnError

      - (folder) Method
         (Item) ID
         (Item) Cmd
         (Repeating Item) Field
            - (Item) Name

    Why am I not seeing a Field list showing the Field names defined in the XML file?

  • 01-09-2015 09:03 AM In reply to

    Re: Defining a Secondary InfoPath Data Source with CAML (XML)

    Because field tree shows the schema, not the values. If you drag the Name attribute onto your form and preview the form, you'll see the values you entered.

    Hilary Stoupa

  • 01-09-2015 09:38 AM In reply to

    Re: Defining a Secondary InfoPath Data Source with CAML (XML)

    I can see that, but I'm not able to access the actual fields in the InfoPath form for editing (position, size, default values, etc.) I'm developing a solution using your post  Codeless submitting InfoPath repeating table to a SharePoint list  and Submitting Data to A SharePoint List. In my case, I need to arrange the fields in repeating table on my form and set the value for the "FormID" field.

  • 01-09-2015 10:20 AM In reply to

    Re: Defining a Secondary InfoPath Data Source with CAML (XML)

    To display the fields in specific places on your form, you can just put controls bound to the field data source and set the repeating section to display only if Name = Organization (for example) so that right field displays where you would like it.

    You can add to this schema without it preventing the CAML from working, which can make setting values easier - you could add another attribute called "SetValue" for example:

    <Field Name="Title" SetValue="" ></Field>

    Then, you could SetValue to 1 or something, and on that field use a condition to set the right instance. Like - the condition could be if Name = ID, and SetValue = 1, set the Field = ID

    Hilary Stoupa

  • 03-27-2016 04:51 AM In reply to

    Re: Defining a Secondary InfoPath Data Source with CAML (XML)

     Hello Hilary,

     Related to this post, I would like to populate one of my secondary (CAML) data connection fields "RequestID" with a value of a textbox from the primary (Main) data connection "ID". I tried several action rules with no success. Can you kindly please help me with this task. Thank you.

    Never mind I've figured it out. But thank you for your valued contributions.

  • 06-20-2016 03:19 AM In reply to

    Re: Defining a Secondary InfoPath Data Source with CAML (XML)

    Hello Hilary, I need assistance in resolving this lingering issue. I created a form in infopath 2010 where staff can fill in their interest in applying for the company's assets like cars which include:  Toyota Corolla, Toyota Coaster, Toyota Hiace, Toyota Hliux and it is submitted to a library called Corolla. The list of cars with columns like Vehicle Type, Vehicle Number, Amt to be Paid, Age, CurrentKM is in a list called Vehicles.

     I created a repeating table in Infopath to populate the Vehicle Type, Vehicle Number. The third field is Result.

    Inside the result random number of winners will be populated which is related to the Vehicle Number.

    The way it should be done is that all related staff nos submitted will be grouped to a related Vehicle Number by the Car type and random selection will be done.

    I need assistance on how to do this.

     Thanks and expecting your reply asap.

     

    Tunde

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