0
votes

Ok so I'll try and explain this as best as possible. Within Google's AppMaker I've put a search bar in my main page and I've pretty much copied the Partner Management exactly in terms of :SearchText. The only difference is that in my Server end code I've changed it to this:

function getRequests_(query){

query.where = 'Requestor contains? :SearchText or Date_Of_Request contains? :SearchText or Title contains? :SearchText or Divisions contains? :SearchText or Development_Type contains? :SearchText or Perceived_Annual_Cost_Savings_for_Change_ contains? :SearchText or Website_Nameif_applicable contains? :SearchText or Benefit contains? :SearchText or Reason_for_Request contains? :SearchText or Impact contains? :SearchText or Consultation contains? :SearchText or Communication contains? :SearchText or Status contains? :SearchText'; 
return query.run();
}

And when I go to search, it loads before displaying this error: "Expected Date for value of 'SearchText' parameter. Error: Expected Date for value of 'SearchText' parameter. at getRequests_ (Datasources:50) at datasources.DevRequests.script:1"

Does it want me to convert everything to a string first before searching the data?

1

1 Answers

2
votes

One ot the fields user in the query is Date (I assume it's Date_Of_Request). You need to supply JS Date object to the filter.

So you should change query to:

Date_Of_Request contains? :SearchText

to

Date_Of_Request contains? :SearchDate

And rest of the script to:

...
var date = new Date(query.parameters.SearchText);
query.parameters.SearchDate = isNaN(date.getTime()) ? null : date;
return query.run();