Displaying Dynamic Table/Query in InfoPath? - InfoPath Dev
in

InfoPath Dev

Displaying Dynamic Table/Query in InfoPath?

Last post 04-27-2012 02:49 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-27-2012 12:38 PM

    • timosy
    • Not Ranked
    • Joined on 04-27-2012
    • Posts 2

    Displaying Dynamic Table/Query in InfoPath?

     Hi all,

     I'm stuck on something I thought was simple but after quite a bit of Googling, I'm still stuck.

    Essentially: The InfoPath form is connected to a SharePoint list which just mirrors an Excel spreadsheet.  When I select an item in a drop-down (e.g. an Application Name), I want a read-only textbox/textarea below it which displays all the rows & columns where "Application Name" equals what I selected.  The number of rows would not be static... some Applications would have five rows, some would have three, some would have ten, some would have 60. Fixed number of columns, though.  The textarea would have to be scrollable both vertically & horizontally.

    What it boils down to, though, would be a textarea that just displays the results of something like 'SELECT b, c, d, e FROM table WHERE a.table = $appname'

    Is this possible in InfoPath? I'm at a loss.  Please let me know if this needs further clarification. 

     

  • 04-27-2012 02:31 PM In reply to

    Re: Displaying Dynamic Table/Query in InfoPath?

    Hi - what version of InfoPath / SharePoint? 2007 or 2010?

    Generally, the way we'd do this in InfoPath is with a secondary data source and a repeating table.

    You'd create a secondary data connection to your list - you may have already done this.

    Then, you'd drag the repeating data row from the secondary data connection onto your form - there's your repeating table.

    If you have InfoPath 2007, by default when you query the data source you will get back all the data. You'll need to add conditional formatting to your repeating table to hide any rows where Application is not equal to the field that is bound to your drop down.

    If you have InfoPath / ShP 2010, you can use the secondary data connection query fields - when the drop down field changes, you can set the relevant query field in your secondary data connection and then query it - so that the secondary data connection only has the "right" data in it - no conditional formatting required.

    Hope this helps...

    Hilary Stoupa

  • 04-27-2012 02:38 PM In reply to

    • timosy
    • Not Ranked
    • Joined on 04-27-2012
    • Posts 2

    Re: Displaying Dynamic Table/Query in InfoPath?

     Hi Hilary,

     Thanks for the reply.  I'm using InfoPath 2010.

    I did declare the secondary data source, but currently it displays all 400-some rows.  I went to try to filter (right click, table properties, display, filter) by the value in the initial drop-down, but for some reason everything is greyed out.  Thoughts?  Is that the wrong process for this?

    I dragged & dropped the secondary data source into the form and hit "repeating table".  Is this why everything is greyed out?

  • 04-27-2012 02:49 PM In reply to

    Re: Displaying Dynamic Table/Query in InfoPath?

    You are probably querying on load - walk through your data connection wizard again (data connections, select the list, modify) and when you get to the last screen, deselect the checkbox indicating the query should run on form load.

    Since you are using IP 2010 (and I'm assuming ShP 2010?) you could just use the query fields - on your drop down, set a rule. In that rule, have a condition that it should only run if the drop down field is not blank. Then, set the correct query field in your SharePoint List to the value of the drop down field. Add another rule to execute your query - that should load only the rows you need, which makes your form performance better (why load 400 rows of data if you don't need it, after all!).

    Instead of filtering, use conditional formatting - select the repeating node in the data source task pane (or the table on the form canvas) and click manage rules - add a formatting rule. If Application in your 2ds doesn't equal the field bound to the drop down, hide the row....

    Hilary Stoupa

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