How to query a secondary datasource - database - InfoPath Dev
in

InfoPath Dev

How to query a secondary datasource - database

Last post 01-10-2013 05:21 AM by stormseeker75. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-19-2012 09:45 AM

    How to query a secondary datasource - database

    I've got 2 tables in my primary which I need to use a submit to db function for.  I have data in another table that I want to be able to query as a secondary connection because nothing needs to be submitted.  THere is a common column between these 2 items so the secondary datasource should be able to be queried.  I can get the secondary connection to query, but it's only giving me the first row in the DB and it's not querying based on the common key.  Can someone tell me how to set this so it will work?

  • 12-19-2012 12:54 PM In reply to

    Re: How to query a secondary datasource - database

    Hi - you can add a query connection to a SQL table. But InfoPath doesn't have any built in support to pass in form values to indicate what data you want from the table. When you say SQL is returning only the first row in the DB - what is the behavior you are seeing? I have a feeling that you might be using a formula to return data from your secondary data connection that doesn't include a filter, thus you are always seeing the first value. I sometimes just open up the data source task pane (fields pane in IP 2010) and drag the data fields onto my form and preview, so I can see what data is being returned - you may want to do that. A web search for filter InfoPath secondary data source should turn up some helpful tutorials as well.

    EDIT - wow - I'm sort of incoherent today. What I am trying to say is that I think you probably set up your data connection to return all rows from the table - that is all IP offers out of the box for a SQL / Access DB. And then you'll need to add a filter when you select a value from that secondary data source to make sure you get data from the right row - for example, that commonkey in the main data source = commonkey in the secondary data source.

    Hilary Stoupa

  • 12-19-2012 02:25 PM In reply to

    Re: How to query a secondary datasource - database

    No worries, thanks for your help.  You're right, I've got a couple boxes setup to return the data from the secondary source and it's not filtered.  I've read a bunch of instructions, some written by you, and I can't seem to apply it to my situation.  In this case, I've got a column called MPS ID in both connections.  I want to return data from the secondary connection where these fields match.  I realize I have to set a filter to get the secondary data to display what I want.  Where do I put this filter?  That's the part that I'm not understanding completely (or at all).

  • 01-10-2013 05:21 AM In reply to

    Re: How to query a secondary datasource - database

    If anyone finds this in search of an answer, I figured it out. 

     I had to create a repeating section and populate it with data boxes.  That repeating section needed to be conditioned to hide if the criteria didn't match.

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