Jump to content
  • 0

Using 1 table as the basis of a parameter to read 2nd table



I am not sure what I am doing wrong but I have tried everything I can think of and still I can't get one table to read the result of a search and pass a field (comprised of just numbers) to another table to print out the results. The first table is ingredients in recipes, which I want to search through a field called items and have it return multiple matching answers which pass on a parameter (a number or numbers) from field called recipeID (made up entirely of numbers). Then I want the passed parameter (the matching number(s) in the field recipeID) to go into the table called recipes and have the parameter (recipeID field) be the condition that the matching recipe results are shown. So in the end the user only sees the matching recipe results, not the ingredients, from the 2nd table.

I have tried all the tutorials and forums to no luck. I have also tried different views but that didn't work either (although I may be using them wrong).

Does anyone have any ideas?

I would really appreciate some help.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I am developing a recipe database for a client but unfortunately I can't show any example as the server is locked down by the client. However I will try to explain my problem better.

I have 3 search boxes on a page - 1 simple dropdown search by type of meal which searches the recipe table with the results appearing on a different page, plus a 2nd search by recipe name or contributor which again searches the same recipe table and produces results on a different page. (Both these pass the field 'Title' on as the parameter to list the recipes on a separate results page.)

However the 3rd search has to search a different table (the ingredients table) because the large number of ingredients is all in a separate table. So I created a View combining the recipe table with the ingredients table and matched up the reference numbers in the recipe table that match the ingredients, with the reference numbers listing the ingredients in the other table (ingredients table) and have the results appear on the different page.

But I can't get anything to consistently appear for the 3rd search for ingredients. In each table I have a unique field called recipeID (in the recipe table) and recipe_ID (in the ingredients table). I have created a view where these 2 fields equal each other (there are many entries with the same number in both the ingredients and the recipe tables). I am then passing the same parameter ('Title') to the results page to list the matching recipes.

Obviously, I am doing something wrong but can't figure out what.

And a funny quark of the View is when you hit the back button from the results page, the ingredients that was entered now appears in the 2nd search box (the recipe name or contributor search) so I have to find a way of clearing and resetting the fields before each of the 3 searches as well.

Anyway, any help would be much appreciated. Hopefully I have explained the problem clearly enough, but if not please feel free and ask away.


Link to comment
Share on other sites

  • 0

How are you passing title to next page? Are passing it through URL? Something like: URL?Title=[@field: FiledName]&cbResetParam=1. Please make sure just pass it from one place either inside Caspio or through URL. It won't work if you select both.

If you are passing through URL you should filter it with the same name 'Title' and also after selecting 'Filter data based on your pre-defined criteria' you should check 'Bridge and external parameters'. What cbResetParam=1 does is to reset browser's cache from remembering the previously passed parameter.

IF you want to perform a search again it is better to create a back button instead of using the back button of the browser. You can add a Header/Footer to your page and create your back button: http://howto.caspio.com/customization/i ... -page.html

Make sure you are receiving the parameter with the exact same name that you are passing it. It is good if you can give me the URL of your page to take a look.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...