Hyrum Lindquist
Posts: 0
Joined: Wed Jun 18, 2014 12:57 am

Possible to search more for different parts of info in the same database with same search box?

I made a search button in my app following the tutorial guide for it, but I was wondering what javascript i put into the "where" spot to make it so i can search for more than one "tag" or information. Right now it says,

return '{"Name":"'+value+'"}';

I want it to include being able to search for "Permit_Number" alongside name for example. I also was wondering if it's possible to make it so the search doesnt have to be exactly as it was entered with capitals or lowercase, but if simply part of the word can be searched. Thank you.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Possible to search more for different parts of info in the same database with same search box?

Hi Hyrum.

Yes it's easy to implement with Appery.io platform.

Please use following code instead of yours:

In case if you need "OR" logic:

pre

var whereClause = {$or: [{Name: "nameValue1"}, {Permit_Number: 435}] };

return JSON.stringify(whereClause);

/pre

In case if you need "AND" logic:

pre

var whereClause = {$or: [{Name: "nameValue1"}, {Permit_Number: 435}] };

return JSON.stringify(whereClause);

/pre

See more about it here: http://devcenter.appery.io/documentat...

Regards.

Hyrum Lindquist
Posts: 0
Joined: Wed Jun 18, 2014 12:57 am

Possible to search more for different parts of info in the same database with same search box?

Thanks Yurii for the response, but after copying and pasting it into the place it doesnt work anymore. I tried the "OR" logic one because its the same as the "AND" logic one you gave as well. Most likely just forgetting to replace "or" with "and".

Regardless, the code still isn't working for my app. I shared my app with support already like i've seen other posts ask for just in case. Just to maybe clarify what im asking for, I have multiple columsn in my database like "Name" and "Permit_Number". I have a search box to pull up all the information for each row. So currently if i type in someone's name it'll pull up all the information on that row. I can only search that by "Name" right now though and I'd like to be able to search by "Name" or by "Permit_Number". I hope that helps to understand. Feel free to access the app yourself. It's called PermitAble. Thanks again for you assistance.

Hyrum Lindquist
Posts: 0
Joined: Wed Jun 18, 2014 12:57 am

Possible to search more for different parts of info in the same database with same search box?

Also not sure if you can help out with this as well, but theres an error that comes up when i try to download the windows .xap file. Thanks.
Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Possible to search more for different parts of info in the same database with same search box?

Hi Hyrum.

Currently your code is:

pre

var where = {"$or": [{"Name": value},{"Permit_Number": value}]};
return JSON.stringify(where);

/pre

But it's wrong. You need to use the following:

pre

var where = {"$or": [{"Name": value},{"Permit_Number": parseInt(value) }]};
return JSON.stringify(where);

/pre

Regards.

Hyrum Lindquist
Posts: 0
Joined: Wed Jun 18, 2014 12:57 am

Possible to search more for different parts of info in the same database with same search box?

Yes! It worked! Do you have any idea about why the windows .xap file isnt downloading correctly now though?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Possible to search more for different parts of info in the same database with same search box?

Hi Hyrum.

Please provide us more information about your problem.

May be you have some errors? If so please make and give us screen shots.

Also please clarify did you get it worked before?

Thanks & regards.

Hyrum Lindquist
Posts: 0
Joined: Wed Jun 18, 2014 12:57 am

Possible to search more for different parts of info in the same database with same search box?

Yes the previous problem was solved and i got my search box to function like i wanted. Thank you.

I did take a screenshot of the only thing that shows a problem which is posted earlier in this thread. That's all i know about why the .xap file isnt downloading. The screenshot/problem also doesnt tell me as to what the most likely reason is. It's just blank as you see. I can download the android files and the windows html and vs project files just perfectly fine. It just doesnt download the .xap file.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Possible to search more for different parts of info in the same database with same search box?

Hyrum,

We need more time to verify your app.

We will update you here.

Regards.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Possible to search more for different parts of info in the same database with same search box?

Hi Hyrum,

You use an incorrect Publisher ID. Please set a correct value:
http://social.msdn.microsoft.com/Foru...

Return to “Issues”