Mixing SharePoint Feilds and Local Feilds in a combined repeating table - InfoPath Dev
in

InfoPath Dev

Mixing SharePoint Feilds and Local Feilds in a combined repeating table

Last post 12-09-2013 07:49 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-18-2013 12:22 AM

    • iamglt
    • Not Ranked
    • Joined on 11-18-2013
    • Posts 3

    Mixing SharePoint Feilds and Local Feilds in a combined repeating table

    Hi there,

     I am trying to create a form that extracts data from a SharePoint List and displays that data in a repeating table.  The data from the SharePoint list is a list of scheduled items to be completed on the shift.

    The above works fine, and in my form displays the following info (in a repeating table):

     Time                      Item                              Description

    07:00                      Item A                           Follow this procedure and do this if it fails

    07:05                      Item B                           Follow this procedure and do this if it fails

    All good and well.  Now, what I would like to do is have my form dynamically add some extra feilds per line (that are NOT sourced from the SharePoint Library), so my form would look like this:

     Time                      Item                              Description                                                             Completed                     User                       Date / Time

    07:00                      Item A                           Follow this procedure and do this if it fails                  Y / N (tickbox)               Username               Datestamp

    07:05                      Item B                           Follow this procedure and do this if it fails                  Y / N (tickbox)               Username               Datestamp

    So what I am effectivly trying to do is source the (Time / Item / Description) data from a SharePoint List, display it in a repeating table and add my own fields to that repeating table and save all data to the form locally.

    I can add my own fields to the repeating table, but when I test it out and select the checkbox in the first row, all the checkboxes in all the other rows become ticked as well - it seems they are not unique feilds for every row.

    Next I tried adding the (Completed / User / Date/Time) to the SharePoint list, and this works OK except when I go to save the form, if I reopen the from no data that was entered into the (Completed / User / Date/Time) is saved.

     

    Can anyone point me in the right direction - any help would be greatly appreciated...

    Geoff.

     

     

     

     

    Filed under:
  • 12-05-2013 02:19 AM In reply to

    • iamglt
    • Not Ranked
    • Joined on 11-18-2013
    • Posts 3

    Re: Mixing SharePoint Feilds and Local Feilds in a combined repeating table

    Obviously not.
  • 12-05-2013 07:05 AM In reply to

    Re: Mixing SharePoint Feilds and Local Feilds in a combined repeating table

     Your form will only save data in main data source fields - that's how IP works. If you also wish to save data from a secondary data source, you have to copy it into the main data source - using code or qRules or some XPath magic, since InfoPath doesn't have an out of the box way to do this. If you add a main data source field inside a repeating section bound to a secondary data source, it is not going to work the way you hope - as you have seen, it is likely that you will only be accessing a single instance of that field, even if it is repeating. You will not be able to set values in a secondary data source via InfoPath and save the data.

    What I'd suggest is that you find a way to copy the data into your main data source. If there are a limited number of rows that will come from the SharePoint list, you could add additional rows to your main data source via the form defaults (Data > Default Values) and then use default values in each row's fields that will set them to the value from the SharePoint list. Possible issues would be if your SharePoint items changes and you reopen the form, the value in the form will get updated to the latest - but since you are currently just displaying your 2ds on the form, the same issue exists for you presently.

    Hilary Stoupa

  • 12-07-2013 11:20 AM In reply to

    • iamglt
    • Not Ranked
    • Joined on 11-18-2013
    • Posts 3

    Re: Mixing SharePoint Feilds and Local Feilds in a combined repeating table

    Hi Hillary, Thanks for your response - I now realise its only the main data source fields can be saved. There is one trick that I tried that I think will work for our purposes: (1) I converted all fields above to the SharePoint list, and then added that list as a secondary source in a repeating table. The fields in the repeating table work perfectly as far as functionality goes (i.e. I can click the yes/no check box and write comments etc). (2) Publish the form (3) When user open the form in InfoPath Filler, and after the form is completed, use the Save&Send option to 'Create PDF/XPS Document'. That saves the completed form as a .pdf document which we are happy with. The only thing I am trying to incorporate on my form is to have a button that that the user can click which will save as a .pdf for them - I have tried doing this via VB and the code for this does not seem to work with the NameSapce referenced: Public Sub Print_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs) Dim filename As String Dim nameNode As XPathNavigator nameNode = MainDataSource.CreateNavigator().SelectSingleNode("c:\test", NamespaceManager) filename = nameNode.Value + ".pdf" Me.CurrentView.Export("C:\" + filename, ExportFormat.Pdf) In infopath 2010, it does not seem to recognise me.currentview.export ...
  • 12-09-2013 07:49 AM In reply to

    Re: Mixing SharePoint Feilds and Local Feilds in a combined repeating table

     Is your form a browser form? Or filler?

    Hilary Stoupa

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