Fill in repeating table based on multiple selections - InfoPath Dev
in

InfoPath Dev

Fill in repeating table based on multiple selections

Last post 02-21-2012 03:33 PM by Hilary Stoupa. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-14-2012 11:23 AM

    Fill in repeating table based on multiple selections

    Greetings,

    I have a form which I have a repeating table that is filled in with data filtered by approvers user ID.  There can be multiple approvers so the approver may be approver 1, approver 2, approver 3,...approver 8.  I was doing this with standard infopath, but as my list has grown the form load times have become too long. 

    I'm working on using Qrules and FilterOwssvr to filter before it reaches the form.  No problem to setup a single filter; ie Approver1=<value>, but since I needed to check multiple approver fields I just tossed in an "or".  *FAIL* 

    Is there a way to do this?

    My current action on the filter button... 

    concat("FilterOwssvr /dsname=FilterOwssvr /filter=Approver1UserID /value=", FormUserID) or concat("FilterOwssvr /dsname=FilterOwssvr /filter=Approver2UserID /value=", FormUserID)

     

    SharePoint 2010, InfoPath 2010, Qrules 4.0

  • 02-14-2012 11:33 AM In reply to

    Re: Fill in repeating table based on multiple selections

    Hi -

    Unfortunately, the owssvr.dll URL parameters only allow for equivalency - So, you could have a filter where one field = one value and another field = another value, but not an "or" condition.

    Also, the concat formula above would fail simply because of the syntax, but you're already aware of that.

    So, you are trying to return the rows from your data source where the current user ID is the value of any of the approver fields from the secondary data source? How do you feel about using an OData connection - do you have the ListData.svc set up on your ShP install?

    http://servername/_vti_bin/ListData.svc

    OData has support for more complex queries....

    Hilary Stoupa

  • 02-14-2012 11:48 AM In reply to

    Re: Fill in repeating table based on multiple selections

    Hi Hilary,

    Definately looks like fun.  Found a quick blog about installing.  I checked first by typing in: https://sharepoint.mycompany.com/_vti_bin/listdata.svc and received a "bunch of stuff" listed below.

    I then tried https://sharepoint.mycompany.com/departments/department1/contractmgmt/_vti_bin/listdata.svc?Cmd=Display&List={BCDFE66D-39F4-44AF-B7FF-E721DC3B7E54}&XMLDATA=TRUE, that responded with a "Bad Request".  Do you have a document or recommend one that will give me some insights on how to use the listdata.svc within my form?

    Thank you,

    -Bob

    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>

    - <service xml:base="https://fc.gogoair.com/_vti_bin/listdata.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
    - <workspace>
      <atom:title>Default</atom:title>
    - <collection href="AnnouncementIcons">
      <atom:title>AnnouncementIcons</atom:title>
      </collection>
    + <collection href="Announcements">
      <atom:title>Announcements</atom:title>
      </collection>
    - <collection href="AnnouncmentForm">
      <atom:title>AnnouncmentForm</atom:title>
      </collection>
    - <collection href="AssetLibrary">
      <atom:title>AssetLibrary</atom:title>
      </collection>
    - <collection href="Attachments">
      <atom:title>Attachments</atom:title>
      </collection>
    - <collection href="CacheProfiles">
      <atom:title>CacheProfiles</atom:title>
  • 02-14-2012 01:34 PM In reply to

    Re: Fill in repeating table based on multiple selections

    After some digging, I am able to query my form library using listdata.svc in the browser, but when I try through infopath I receive the error: Not enough storage is available to process this command.

    Here is my command:https://sharepoint.mycompany.com/departments/dept1/contractmgmt/_vti_bin/listdata.svc/Contracts

    I've seen a post on this site, but there was no solution posted.  I do use https: but have no calculated fields, as were some of the cases in other posts.

     Is there a way to resolve the "Not enough storage..." error?

     Thank you

  • 02-14-2012 02:08 PM In reply to

    Re: Fill in repeating table based on multiple selections

    What version of Internet Explorer are you using? I have a vague (but strong) recollection that upgrading to IE 9 resolves this with https......

    Hilary Stoupa

  • 02-15-2012 09:11 AM In reply to

    Re: Fill in repeating table based on multiple selections

    IE9 fixed the issue.  I did not think it would effect the way the designer/preview worked, but it did.

    I have been successful in getting information from my new OData(listdata.svc) data connection by just selecting a value for a text box, but when I try to pre-filter things go south. 

    My filtered 'OData' data connection in InfoPath looks like:

    https://sharepoint.mycompany.com/departments/dept1/contractmgmt/_vti_bin/listdata.svc/Contracts$filter=Approver1UserID eq 'bsieloff'

    two things happen.

    1) I'm asked to put in my credentials (https thing?)

    2) error on the url string.  both directly from IE or in InfoPath

    Looking at examples on the web, I thought my syntax was correct.  Any suggestions?

    Thank you

  • 02-15-2012 09:21 AM In reply to

    Re: Fill in repeating table based on multiple selections

    Here's a link to the URI conventions. Here's a link to a demo video I did on OData with SharePoint.

    Are you positive that Approver1UserID is the correct object name? Are you positive that the values include 'bsieloff'?

    If you use just your link to Contracts in the browser, what do you get back?

    I don't quite understand what this means:

    bsieloff:
    I have been successful in getting information from my new OData(listdata.svc) data connection by just selecting a value for a text box, but when I try to pre-filter things go south. 

    Hilary Stoupa

  • 02-15-2012 12:30 PM In reply to

    Re: Fill in repeating table based on multiple selections

    Great links and video... I still think I'm doing this correct, but the computer disagrees,

     If I link to contracts, I get a whole lot of this (listed below)

    I have been working under the assumption that my field name is the object name, although that may not be the case.

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <feed xml:base="https://fc.CompanyDomainair.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
      <title type="text">Contracts</title>
      <id>https://SharePoint.Company.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/Contracts/</id>
      <updated>2012-02-15T16:42:23Z</updated>
      <link rel="self" title="Contracts" href="Contracts" />
      <entry m:etag="W/&quot;13&quot;">
        <id>https://SharePoint.Company.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/Contracts(93)</id>
        <title type="text">Contract.xml</title>
        <updated>2011-08-11T20:47:27-05:00</updated>
        <author>
          <name />
        </author>
        <link m:etag="&quot;{57FAAA8A-98AA-4523-Aa58-129BaaaaaCC8},13&quot;" rel="edit-media" title="ContractsItem" href="Contracts(93)/$value" />
        <link rel="edit" title="ContractsItem" href="Contracts(93)" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="Contracts(93)/CreatedBy" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="Contracts(93)/ModifiedBy" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CheckedOutTo" type="application/atom+xml;type=entry" title="CheckedOutTo" href="Contracts(93)/CheckedOutTo" />
        <category term="Microsoft.SharePoint.DataService.ContractsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <content type="text/xml" src="https://fc.CompanyDomainair.com/departments/legal/contractmgmt/Contracts/Contract.xml" />
        <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
          <d:ContentTypeID>0x01010100E89757AA0F42CD4087AD0B03D010ED87</d:ContentTypeID>
          <d:Name>ContractName.xml</d:Name>
          <d:Title>ContractName.xml</d:Title>
          <d:ManagerName>MickeyMouse</d:ManagerName>
          <d:ManagerEmail>[email protected]</d:ManagerEmail>
          <d:ManagerAccountID>CompanyDomain\MiniMouse</d:ManagerAccountID>
          <d:CompanyAddress>123 Main Street</d:CompanyAddress>
          <d:CompanyName>Company A</d:CompanyName>
          <d:CompanyCity>AnyWhere</d:CompanyCity>
          <d:CompanyState>AA</d:CompanyState>
          <d:CompanyZip>11122</d:CompanyZip>
          <d:CompanyContact>Michael Jorden</d:CompanyContact>
          <d:CompanyContactPhone>(555) 411-9999</d:CompanyContactPhone>
          <d:ContractType>Vendor Contracts and Agreements</d:ContractType>
          <d:ContractAction>Independent Contractor/Consultant/Subcontractor Agreements (includes temporary employees)</d:ContractAction>
          <d:ContractSubmitted m:type="Edm.Int32" m:null="true"></d:ContractSubmitted>
          <d:Approver1UserID>CompanyDomain\mmouse</d:Approver1UserID>
          <d:Approver2UserID>CompanyDomain\dduck</d:Approver2UserID>
          <d:Approver3UserID>CompanyDomain\minmouse</d:Approver3UserID>
          <d:Approver4UserID>CompanyDomain\hueyduck</d:Approver4UserID>
          <d:Approver5UserID>CompanyDomain\louieduck</d:Approver5UserID>
          <d:Approver6UserID m:null="true"></d:Approver6UserID>
          <d:Approver7UserID m:null="true"></d:Approver7UserID>
          <d:Approver8UserID m:null="true"></d:Approver8UserID>
          <d:Approver1DisplayName>Mickey Mouse</d:Approver1DisplayName>
          <d:Approver2DisplayName>Donald Duck</d:Approver2DisplayName>
          <d:Approver3DisplayName>Mini Mouse</d:Approver3DisplayName>
          <d:Approver4DisplayName>Huey Ducks</d:Approver4DisplayName>
          <d:Approver5DisplayName>Louie Duck</d:Approver5DisplayName>
          <d:Approver6DisplayName m:null="true"></d:Approver6DisplayName>
          <d:Approver7DisplayName m:null="true"></d:Approver7DisplayName>
          <d:Approver8DisplayName m:null="true"></d:Approver8DisplayName>
          <d:CompanyContactEmail>[email protected]</d:CompanyContactEmail>
          <d:ContractAmount m:type="Edm.Double">44800</d:ContractAmount>
          <d:ContractDateNeeded m:type="Edm.DateTime">2011-08-01T00:00:00</d:ContractDateNeeded>
          <d:LegalFormation m:null="true"></d:LegalFormation>
          <d:ApprovalPending>Completed</d:ApprovalPending>
          <d:ApprovalPlace>9</d:ApprovalPlace>
          <d:LegalPlace>Completed</d:LegalPlace>
          <d:LegalTime m:type="Edm.DateTime">2011-08-03T16:59:01</d:LegalTime>
          <d:Approval1Time m:type="Edm.DateTime">2011-08-03T17:20:59</d:Approval1Time>
          <d:Approval2Time m:type="Edm.DateTime">2011-08-04T14:43:37</d:Approval2Time>
          <d:Approval3Time m:type="Edm.DateTime">2011-08-04T12:53:47</d:Approval3Time>
          <d:Approval4Time m:type="Edm.DateTime">2011-08-11T20:47:18</d:Approval4Time>
          <d:Approval5Time m:type="Edm.DateTime">2011-08-04T10:21:54</d:Approval5Time>
          <d:Approval6Time m:type="Edm.DateTime" m:null="true"></d:Approval6Time>
          <d:Approval7Time m:type="Edm.DateTime" m:null="true"></d:Approval7Time>
          <d:Approval8Time m:type="Edm.DateTime" m:null="true"></d:Approval8Time>
          <d:CompanyDomainContactUserID>CompanyDomain\pblisard</d:CompanyDomainContactUserID>
          <d:CompanyDomainContactDisplayName>Jason Cohen</d:CompanyDomainContactDisplayName>
          <d:StrFilename>IdeaNova92</d:StrFilename>
          <d:DateSort>Aug 2011</d:DateSort>
          <d:SortYear>2011</d:SortYear>
          <d:SortMonth>Aug</d:SortMonth>
          <d:TerminationReason m:null="true"></d:TerminationReason>
          <d:TermNoticeDays>1</d:TermNoticeDays>
          <d:YNTermNotice>no</d:YNTermNotice>
          <d:YNConvclause>yes</d:YNConvclause>
          <d:YNAssignProvision>yes</d:YNAssignProvision>
          <d:Lockform>yes</d:Lockform>
          <d:FileAttachment m:type="Edm.Int32" m:null="true"></d:FileAttachment>
          <d:ClientContract>Contract.xml</d:ClientContract>
          <d:ParallelSignOff m:type="Edm.Int32" m:null="true"></d:ParallelSignOff>
          <d:ClientFile>Contract.xml</d:ClientFile>
          <d:ContractSubmittedParallel m:type="Edm.Int32" m:null="true"></d:ContractSubmittedParallel>
          <d:BusinessUnit>BA</d:BusinessUnit>
          <d:DocumentReview>review</d:DocumentReview>
          <d:StartDate m:type="Edm.DateTime">2011-08-01T00:00:00</d:StartDate>
          <d:TermNotificationDate m:type="Edm.DateTime">2011-12-30T00:00:00</d:TermNotificationDate>
          <d:Start_Schedule m:type="Edm.Int32" m:null="true"></d:Start_Schedule>
          <d:ScheduleWorkflow m:type="Edm.Int32" m:null="true"></d:ScheduleWorkflow>
          <d:ContractNotes m:null="true"></d:ContractNotes>
          <d:LegalApprovalName m:null="true"></d:LegalApprovalName>
          <d:Id m:type="Edm.Int32">93</d:Id>
          <d:ContentType>Form</d:ContentType>
          <d:Created m:type="Edm.DateTime">2011-08-03T10:25:02</d:Created>
          <d:CreatedById m:type="Edm.Int32">1</d:CreatedById>
          <d:Modified m:type="Edm.DateTime">2011-08-11T20:47:27</d:Modified>
          <d:ModifiedById m:type="Edm.Int32">1</d:ModifiedById>
          <d:CopySource m:null="true"></d:CopySource>
          <d:ApprovalStatus>0</d:ApprovalStatus>
          <d:Path>/departments/legal/contractmgmt/Contracts</d:Path>
          <d:CheckedOutToId m:type="Edm.Int32" m:null="true"></d:CheckedOutToId>
          <d:VirusStatus>52600</d:VirusStatus>
          <d:IsCurrentVersion m:type="Edm.Boolean">true</d:IsCurrentVersion>
          <d:Owshiddenversion m:type="Edm.Int32">13</d:Owshiddenversion>
          <d:Version>1.0</d:Version>
        </m:properties>
      </entry>

  • 02-15-2012 12:51 PM In reply to

    Re: Fill in repeating table based on multiple selections

    So, given this:

    <d:Approver1UserID>CompanyDomain\mmouse</d:Approver1UserID>

    A URL like this should work:

    https://sharepoint.mycompany.com/departments/dept1/contractmgmt/_vti_bin/listdata.svc/Contracts$filter=Approver1UserID eq 'CompanyDomain\mmouse'

    If your browser claims it can't display anything, be sure to view source on the page....

    Does InfoPath give an error if you try to create a data connection with the link above?

    Hilary Stoupa

  • 02-15-2012 01:59 PM In reply to

    Re: Fill in repeating table based on multiple selections

    ok, good to confirm I was creating the correct syntax before

    when I look at the source on the webpage after adding the $filter=Approver1UserID eq 'domain\username' to the UNI, it just states the standard 404 error information

    when I create the data connection with the filter in infopath I receive:

    1) I'm asked for my credentials ( I type them in, asked for credintials again, type them in, asked for credintials again, ... until I hit cancel)

    2) First message from Infopath: The internet address https://sharepoint.mycompany.com/depatments/dept1/contractmgmt/_vti_bi/listdata.svc/Contracts$filter=Approver1UserID eq 'Mydomain\userID' is not valid

    3) Second message from infopath: InfoPath cannot open the xml document https://sharepoint.mycompany.com/depatments/dept1/contractmgmt/_vti_bi/listdata.svc/Contracts$filter=Approver1UserID eq 'Mydomain\userID' . The file cannot be accessed

    I'm the collection admin

    Thanks, -B

  • 02-15-2012 02:08 PM In reply to

    Re: Fill in repeating table based on multiple selections

    I'm assuming you are using actual values in the Domain\username that have a match, correct?

    Hilary Stoupa

  • 02-15-2012 02:12 PM In reply to

    Re: Fill in repeating table based on multiple selections

    I'm a complete dork - your syntax is off - missing a ? before $filter

    Hilary Stoupa

  • 02-15-2012 02:27 PM In reply to

    Re: Fill in repeating table based on multiple selections

    That did it.

    Thank you!.. now on to my origianal test of using boolean "or" to check all the Approver fields for a single name.

    Seemed very slow in the desinger/preview mode, but hopefully it is much quicker in the browser.

  • 02-15-2012 02:38 PM In reply to

    Re: Fill in repeating table based on multiple selections

    Since this is a REST data connection, you'll be able to use rule actions to change the URL and then re-query.

    Hopefully it will be faster for you in the browser - you may want to test sooner rather than later... ;-}

    Hilary Stoupa

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

    Re: Fill in repeating table based on multiple selections

    Greetings,

    I thought I would post my final query as it may help someone else doing something similar in the future: <<pasted below>>

    One more question. 

    I am now looking to fill in some fields based on the form library row Id.  I use listdata.svc in this manner:

    concat("https://sharepoint.mycompany.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/Contracts(", SelectedRowID, ")?$select=CompanyName,Id,CompanyContact,StartDate,CompanyAddress,CompanyCity,CompanyState,CompanyZip,CompanyContactPhone,CompanyContactEmail,ContractAmount,ContractType,BusinessUnit,ContractNotes")

    to make sure it was working ok, i created a text box and placed the odata query in it to show me the values being passed.  A sample looks like:

    https://sharepoint.mycompay.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/Contracts(378)?$select=CompanyName,Id,CompanyContact,StartDate,CompanyAddress,CompanyCity,CompanyState,CompanyZip,CompanyContactPhone,CompanyContactEmail,ContractAmount,ContractType,BusinessUnit,ContractNotes

    If I copy and past the above link into a browser it does return a result for that selected Id (378, in this example)

    <<>>= data connection

    I then have a text box named <<main>>"CompanyName"  where I set it's value to <<odata connection>>"CompanyName" but nothing/null is shown in the <<main>>"CompanyName" text box

    I should only be returned the data for the row id that is selected, which I confirmed, but for some reason when I set a text box value = to the corrisponding odata value it does not show, any ideas why?

    Thanks,

    -------------- follow up ----------

    Data connections with several 'or' statements

    concat("https://sharepoint.mycompany.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/Contracts?$select=Title,CompanyName,Id,CompanyContact,StartDate&$filter=((Approver1UserID eq '", FormUserID, "' or Approver2UserID eq '", FormUserID, "' or Approver3UserID eq '", FormUserID, "' or Approver4UserID eq '", FormUserID, "' or Approver5UserID eq '", FormUserID, "' or Approver6UserID eq '", FormUserID, "' or Approver7UserID eq '", FormUserID, "' or Approver8UserID eq '", FormUserID, "') and ApprovalPending ne 'Completed')")

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