Jump to content
  • 0

Searching Multiple Database Records Using Multiple Fields


Toby

Question

Hi 

 

I am new to using Caspio and would appreciate some help building a form and report which searches across 4 language database entries (L1-L4). I need 9 language search boxes in 3 columns (this will be expanded later to allow more parameters). The logical connection between each of the four boxes in each column vertically is AND and the relation between the 3 columns horizontally is OR. For example, to find people in the database who speak English and German and/or Spanish (and any combination of these), would look like on the search form:

 

English                      English                    English                       

 

AND                            AND                         AND                         

 

Spanish     OR          Spanish        OR     German      

 

AND                             AND                        AND                        

 

German                 [no selection]             [no selection]           

 

 

I have built the form datapage using virtual fields to try to pass on to the report but I am struggling at this point. I can see that it is easy to have one search box searching records in L1-L4 using virtual fields, but not multiple search boxes searching multiple records in L1-L4.

 

I have already looked at the various tutorials and guides on the caspio site but I cannot work this out. 

 

My general query is: is this possible?

My more specific question is: is it possible to pass parameters from more than one virtual field to the report? More particularly, if, as in the case above, I have made no selection, can Caspio be told to ignore those fields for the purposes of the search?

 

Many thanks for your help

 

Toby

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

In ore-defined report you can check " If empty, ignore criteria " in advanced tab. How is your table setting? Do you have one field to search for language?

 

If you have language in one column and you want to search for the column that includes for instance Spanish OR English, you can have one virtual field check box for each option on your search form. Write a javascipt to combine these values separated by OR on submit:

For instance:

<SCRIPT LANGUAGE="JavaScript"> 
  function concatenate() { 
  var position1 = document.getElementById("cbParamVirtual1").value; 
  var position2 = document.getElementById("cbParamVirtual2").value;
  var allpositions = position1 + "OR" +position2; 
  document.getElementById("cbParamVirtual3").value = allpositions; 
} 
document.getElementById("caspioform").onsubmit=concatenate; 
</SCRIPT>

And check to pass Virtual 3 to next page which is pre-defined report. On report page you should change Comparison Type which is Equal by default to CONTAINS

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.

Guest
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.

Loading...
×
×
  • Create New...