Filtering a Repeating table from a Secondary Data Source - InfoPath Dev
in

InfoPath Dev

Filtering a Repeating table from a Secondary Data Source

Last post 09-22-2008 02:03 PM by mjaneczk. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-15-2008 05:18 AM

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Filtering a Repeating table from a Secondary Data Source

    I am having an issue trying to filter a repeating table which reads from a seocndary data source.  In fact the secondary data source is a SharePoint List.  I found this article (http://office.microsoft.com/en-us/infopath/HP011066131033.aspx)  from Microsoft which sates (my bolding and underlining)

    Note  You can only filter data from a primary data source. Because you cannot filter data from a secondary data source, the Display tab for a control connected to a secondary data source does not include any filter options.

    Is there a way around this?  I was thinking I could put a view on the SharePoint List which does the filtering for me.  I haven't found out how to create a secondary data conenction to a view. 

    Any suggestions?

     

    Mike Janeczko
    Ford Motor Company
  • 08-15-2008 09:47 AM In reply to

    Re: Filtering a Repeating table from a Secondary Data Source

    Hello,

    it is right that you can“t filter a SharePoint list if you use the data source "SharePoint List". But you can instead use the data source "XML Document" which is another option in the assistant for creating secondary data sources.

    This way is described in the following article from "Infopath Team Blog". Of course by using this way you can use a view and even filter conditions.

    Please have a look at:

    http://blogs.msdn.com/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx

    Hope that helps.

    Karsten

    Karsten
  • 08-15-2008 10:43 AM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: Filtering a Repeating table from a Secondary Data Source

    Thanks for the reply.  I read the article and gave it a try.  However I am having some difficulty.  The XML that is returned is below.  It describes all the columns but doesn't have the actual data.  Am I doing something wrong?  My URL is below also.

     URL: https ://server/site/_vti_bin/owssvr.dll?Cmd=Display&List={C3AD1F34-C325-430E-BD9C-F6A3BF9D8E19}&View={E01AD6F9-0104-443D-9C3E-1FDBD1C856BE}&XMLDATA=TRUE 

    [NOTE: I had to put a space after https so that all of teh URL would show].

    - <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <s:Schema id="RowsetSchema">
    - <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
    - <s:AttributeType name="ows_Attachments" rs:name="Attachments" rs:number="1">
      <s:datatype dt:type="boolean" dt:maxLength="1" />
      </s:AttributeType>
    - <s:AttributeType name="ows_LinkTitle" rs:name="Title" rs:number="2">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_DeptCode" rs:name="DeptCode" rs:number="3">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_PriOwnerEmail" rs:name="PriOwnerEmail" rs:number="4">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_PriOwnerId" rs:name="PriOwnerId" rs:number="5">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SecOwnerEmail" rs:name="SecOwnerEmail" rs:number="6">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SecOwnerId" rs:name="SecOwnerId" rs:number="7">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SiteDesc" rs:name="SiteDesc" rs:number="8">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SiteName" rs:name="SiteName" rs:number="9">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SiteTitle" rs:name="SiteTitle" rs:number="10">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_Status" rs:name="Status" rs:number="11">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SiteType" rs:name="SiteType" rs:number="12">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_SpecProv" rs:name="SpecProv" rs:number="13">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_Selected" rs:name="Selected" rs:number="14">
      <s:datatype dt:type="boolean" dt:maxLength="1" />
      </s:AttributeType>
    - <s:AttributeType name="ows_Requestor" rs:name="Requestor" rs:number="15">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
    - <s:AttributeType name="ows_Approver" rs:name="Approver" rs:number="16">
      <s:datatype dt:type="string" dt:maxLength="512" />
      </s:AttributeType>
      </s:ElementType>
      </s:Schema>
      <rs:data />
      </xml>
    Mike Janeczko
    Ford Motor Company
  • 08-26-2008 08:44 AM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: Filtering a Repeating table from a Secondary Data Source

    Does anyone have any help on this?  I am baffled. 

    Mike Janeczko
    Ford Motor Company
  • 08-26-2008 11:34 AM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: Filtering a Repeating table from a Secondary Data Source

    I think I solved this.  In order to get the URL for the view, I did the following:

    1. Create the view - do whatever filtering you need. 
    2. View the view - click on the list and select the view. 
    3. Click Actions->Export to SpreadSheet. 
    4. Click Save - this will save an owssrv.iqy file. 
    5. Open up the owssrv.iqy file in Notepad. 
    6. You will see a long URL there.  Copy this:
    7. Build your data conenction -
      1. select receive
      2. select XML file
      3. Paste in the URL from 6) 1). (above) 
      4. select "Access the data from specified location"
      5. Uncheck Store copy of the data for offline use.  <--- IMPORTANT - if checked this will keep old data in the form.
      6. Name the conenction. 
      7. Check Automatically retreive data when form is opened.  <-- IMPORTANT - will retreive each time form is opened. 

     From there you have a data connection to a view.  I created a repeating table off this view. 

    The key to the article is to get the proper URL to the view.  That is what gave me problems.  It wasn;t until I was able to get the URL from "Exporting to SpreadSheet" that I was able to get over my trouble. 

     I hope this works out for people. 

    Mike Janeczko
    Ford Motor Company
  • 09-22-2008 02:03 PM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: Filtering a Repeating table from a Secondary Data Source

    I found one little quirk with this.  When starting from an empty list the view will thus not return anything.  Thus, when you are in InfoPath design mode, you will not be able to create a repeating table from this empty list.  To get around this, populate the list with a few rows of dummy data.  One row doesn't work for a "repeating" table.  Once the you get everything set up, remove the dummy data.  The form should still work. 

     

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