How to filter secondary data source - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

How to filter secondary data source

Last post 12-21-2016 10:45 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-21-2016 10:32 AM

    How to filter secondary data source

    I have a three step 2010 style workflow in SPD 2013. In first two steps user is asked to enter "Color" name for e.g. red, green, blue etc. and in 3rd step, the data that was entered in first two steps is displayed on screen and then user presses "Approve" or "Rejected" to approve or reject.

    In all three steps, task form being used is created automatically by SharePoint which I open in InfoPath 2013 to edit.

    In last step I am displaying data by creating a data connection to Tasks list i.e. secondary data source. And then I display "Color" field in repeating table. To ensure that only current item's data is displayed from Tasks list which contain data for all items, I am using rule to hide other data. In that rule I am comparing if item ID in tasks list is equal to current item ID (in Main data source).

    It is working fine but then I realized this approach is wrong because it will work if data in Tasks list is less for e.g. a few hundred may be. But what will happen when there are thousands of records in Tasks list. Surely this will slow down loading of task form in last step because as I said earlier, I am loading all rows from Tasks list and then hides the one which doesn't belong to current item.

    Is there a better way to do this? I mean is it possible to filter incoming data so not all rows are read?
  • 12-21-2016 10:45 AM In reply to

    Re: How to filter secondary data source

     Set your secondary data connection to NOT query when the form loads (that is a checkbox that is in the last screen of the data connection wizard, or maybe the next to the last - modify the data connection and walk through it). Then in your form, in a form load rule, set the query item id field in the secondary data source to the main data source item id. Add another rule to run the query - that should get you back just the items you need.

    To get the hang of using query fields, you may want to temporarily put them on the form with a button that executes the query (and the data fields so you can see the results!) and then you can try setting query fields, running the query and see what you get back. :) 

    Hilary Stoupa

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