Solved

Can I do a Filtered Data Connection Query on an InfoPath form?

Posted on 2008-10-29
2
2,061 Views
Last Modified: 2012-05-05
Inside an InfoPath form, is it possible to read data from a data connection based on information that has been entered by the user?

An example of this is having a drop down box where the user selects a category (i.e., frozen food, canned vegetables, magazines, etc).  After the user has made his choice, a select group of products will then be read from a data connection and be made available in a second drop down list.  As another example, if the user selected Canned Vegetables, he would see Green Giant Whole Kernel Corn, Libbys Sliced Carrots, Del Monte Sweet Peas, etc. and not see any Frozen Food or Magazines as choices.

I know it can be done like this using Visual Basic and C# programming using Visual Studio but I want to do this simple thing using SharePoint alone.

The first drop down box is no problem.  We have similar scenarios going already where we are reading from SharePoint lists over a web service data connection.   But in this case we would be applying a filter; currently we pull all data from the SharePoint lists.

Also  there is a question of timing.  I cant poll the data connection until after the user has responded to the first data field.  On the properties of the data connections, I see only the option to get the data at the time the form is loaded.  This tells me that the only option I have is to add a button that queries the data connection after the selection is made.  That would be my event.  

But, from what I see, using a button to query the data connection still brings across the full set of data from the SharePoint list because there appears to be no way to pass an argument as a filter to the data connection.

Hopefully, there is some "trick" here that is not obvious to me.  I thank you for any insights you can share with me.
0
Comment
Question by:DBaileyFoxGal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 22841939
Hey There.

"casacading dropdowns" as they are referred to are pretty straightforward using filters.  I know there are many tutorials for InfoPath around, you can use www.infopathdev.com.

Doing a select query for SharePoint is not possible. You have to load the whole list into InfoPath and then filter for the values you need.  This can be a performance issue if the lists are large but the end result of a cascading dropdown is the same. When you setup the second dropdown use the filter button to only allow the fields where the first dropdown value = the list value.

You would need the data in SQL and use webservices to be able to do a selective query as you describe.
0
 

Author Closing Comment

by:DBaileyFoxGal
ID: 31511343
many thanx!  I found what I was seeking in one of the turorials you directed me to.

I appreciate your help!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
centralized repository for hosting the internal data and view 1 86
CA single sign on 2 102
Widget to get customer remakrs in our website. 3 110
Survey branching tutorial 11 45
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question