locked
Returning information from 2 different data sources after inputting single search value RRS feed

  • Question

  • Hi All,

    I have a simple lightswitch BROWSE page that searches a single table in a single data source. Is it possible to add a second data source and from within the existing page, after I enter my search term, it searches both the existing data source and the new data source and outputs the results in 2 separate tables on the same page?

    The 'easy-not-so-friendly- way is to add a second data source to my solution, and create a separate browse page for that...but that's not very user-friendly.

    The user would like to search say 'UserID' and search through 2 data sources for different info based on that UserID and output to a single page.

    thanks in advance!

    Wednesday, April 2, 2014 8:25 PM

Answers

  • You need to familarise yourself with the menus, buttons and properties window. In screen design at the top is add data, via there you can add a query. On the ledt are screen properties, collections, single entity types and scalar properties. You bind the query parameters to scalar properties via property window. Drag scalar parameters onto the screen content to make editable filter fields. There are lots of tutorials. Work through the instructions and be inquisitive as to the function of all the menus and buttons. When you get to be expert what you want to do will literally take one minute. Dave

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by dnaman Wednesday, April 2, 2014 9:27 PM
    Wednesday, April 2, 2014 9:12 PM

All replies

  • Why not give it a try. If you have two queries with parameters that are bound to the same screen properties, your filter criteria, it should work nicely. Dave

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Wednesday, April 2, 2014 8:29 PM
  • Why not give it a try. If you have two queries with parameters that are bound to the same screen properties, your filter criteria, it should work nicely. Dave

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Problem is, i'm not experienced in web development (only picked this up a week ago!) so not quite sure where to begin.

    I added a 2nd data source to my solution and created a query off it. How do I 'attach' this 2nd query to my existing browse screen (I remembered I created this browse screen and then specified the first query as my data source but it was all wizard-driven)?

    Wednesday, April 2, 2014 9:04 PM
  • You need to familarise yourself with the menus, buttons and properties window. In screen design at the top is add data, via there you can add a query. On the ledt are screen properties, collections, single entity types and scalar properties. You bind the query parameters to scalar properties via property window. Drag scalar parameters onto the screen content to make editable filter fields. There are lots of tutorials. Work through the instructions and be inquisitive as to the function of all the menus and buttons. When you get to be expert what you want to do will literally take one minute. Dave

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by dnaman Wednesday, April 2, 2014 9:27 PM
    Wednesday, April 2, 2014 9:12 PM
  • You need to familarise yourself with the menus, buttons and properties window. In screen design at the top is add data, via there you can add a query. On the ledt are screen properties, collections, single entity types and scalar properties. You bind the query parameters to scalar properties via property window. Drag scalar parameters onto the screen content to make editable filter fields. There are lots of tutorials. Work through the instructions and be inquisitive as to the function of all the menus and buttons. When you get to be expert what you want to do will literally take one minute. Dave

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Thanks Dave, a little prodding helped me along. I added a Data Item, added my query then I was 'stuck' in figuring out how to bind it to my initial search parameter.

    Then I realize in the property pane, under my new query, I could do 'Parameter Binding' of my query search/filter to the search term.

    Now it works! Ugly-looking but that's a different story.

    Wednesday, April 2, 2014 9:29 PM