Jump to content
  • 0
JSLane

One Search Term for Many Fields

Question

Hi - New Caspio user here...I have a database that was created in MS-Excel with records for research citations that I want others to be able to search. The original file has multiple keyword fields so that people could use drop-down boxes to select more than one keyword. In Excel, this was represented as three columns with headers Keyword 1, Keyword 2, and Keyword 3. Now in Caspio I really want just one search term - Keyword - that will look up the same value for any of the three keyword fields in the database. So...the search term for Keyword is "Resiliency" and Caspio searches the three data table fields Keyword 1, Keyword 2, and Keyword 3 and returns any record that has the term "Resliency" in ANY of the three keyword fields. Right now there are three keyword fields, one for each of the three keyword columns in the database.

Thank you for any help you can offer.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @JSLane,

It is doable in Caspio.

You should use separate form (Submission Form Datapage) which passes a parameter to the Report Datapage.

The trick here is that you will have multiple fields in report datapage which receive a single parameter.

This concept described in the following article:

https://howto.caspio.com/faq/reports-datapages/how-to-do-keyword-search-across-multiple-fields/

I would also suggest watching the following tutorial video which explains how to pass parameters between separate form embedded on single web-page.

https://www.youtube.com/watch?v=K3CKFjuSIt4

Hope this helps.

Regards,

vitalikssssss

 

Share this post


Link to post
Share on other sites
  • 0

FYI, for benefit of others with similar problem that want to use a single page with the search criteria displayed above the Results.

//insert script below into Footer of "Configure Search Fields"
<script>

document.addEventListener('DataPageReady', function (event) {
 
// Create a new Virtual Field (in my case cbParamVirtual1) for user to enter the search parameter.  
// The below code will execute when the user updates the Virtual Field and then stamp it into multiple fields.  
 var x10  = document.querySelector('[id=cbParamVirtual1]');
   x10.onchange = function() {
		document.getElementById('Value1_1').value = document.getElementById('cbParamVirtual1').value;
		document.getElementById('Value2_1').value = document.getElementById('cbParamVirtual1').value;
		document.getElementById('Value3_1').value = document.getElementById('cbParamVirtual1').value;
  }
})

</script>

 

Also you'll need to edit items under the Logic tab as follows:

image.png.38d850492307539ed5bd5d2f4e15e5c4.png

 

After you test, you can hide the fields:  Value1_1,   Value2_1, etc

Share this post


Link to post
Share on other sites
  • 0

I am unable to get this to work.

Is there something I am missing with the syntax to reference the fields?

<script>

document.addEventListener('DataPageReady', function (event) {
 
 var x10  = document.querySelector('[id=cbParamVirtual1]');
   x10.onchange = function() {
  document.getElementById('TrackerAdopterInterestedDog1ID_FK').value = document.getElementById('cbParamVirtual1').value;
  document.getElementById('TrackerAdopterInterestedDog2ID_FK').value = document.getElementById('cbParamVirtual1').value;
  document.getElementById('TrackerAdopterInterestedDog3ID_FK').value = document.getElementById('cbParamVirtual1').value;
  }
console.log("Test");
}
</script>

 

Share this post


Link to post
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...