How to create relative search

hey so I went through the blocks and they work fine, but I want a way to integrate this in our search feature too since search is the main aspect of our app

so how can I create city specific search?
such that
when I search library by book title, I get results within the city we have selected

It sounds like maybe you need to create a list of the cities, libraries and book titles. Then workout the logic to return the desired data based on the selected list item. We could do this with functions and passing the specific arguments… you’ll just have to duplicate the function on the different screens if necessary.

Let me ask this, what happens if someone searches for a partial string like “mockingbird”… should it find “To Kill a Mockingbird”? What I’ve done so far has only looked for the string using an = statement, not a partial match.

yes I would want that, the initial plan was to create a robust search feature, not to aim too high but something close to google search

it shows suggestions while you search for a thing, it can also recognize partial searches to some extent as I don’t want purely partial search feature

but in a nutshell yes I want partial search

I added a new home screen to the mock up, and it is configure for the relative search. Right now the data is returned to a list for the results from the compiled lists.

I’m not sure how you want to to display the data, but based on the other screens, if a city is returned would they go to the screen w/ the libraries listed?
If they click on a library would they see the books?
If they click on a book would they see the book details, and all of the libraries in the cities they can find the book?

Okay so I made a video of how exactly I want the app to work

check it out and you’ll get the exact idea of how I want the app to function

1 Like

I just watched the video, and I think I understand what you’re trying to accomplish. I think I’m headed in the right direction with the mock up I started based on what you’re looking to do.

Working through this, bit by bit, and here’s what I have so far.
https://x.thunkable.com/projectPage/66796d594c50947feef58e7a

I just need to refactor the search page to display the libraries in the city w/ that book, just don’t have time to spend on it now.

hey that is actually helpful, I actually have a different issue that I have been facing

you remember our very first search feature at the beginning of this thread?

so this happens in it
so when you search book, you get library

but when I go back to the search feature and search something in the same session, it does show right results but it shows then twice in the list like you can see below

here are all the blocks for the search page



how can I solve this issue?

To keeps items from being duplicated in the list you need to make sure it doesn’t already exist in the list using the “does list contain” block.

Here’s an example:

You just need to make sure you replicate it where you build out your list, and swap out your var names.

1 Like

so I’m confused as to which variables do I use to create this for this to work

I tried some combinations in searchInput function and also in getLibData function but they aren’t really working

Out of the blocks you listed there’s only one that’s adding anything to a list:

I would wrap that in the “if/do” bock and only add that item to the list, if it’s not already in the list.

1 Like

hey it got solved thank you the app is almost ready to launch

gotta make some changes but it is almost ready

so our long journey finally ends lol

but I am very thankful for all your help

thank you

1 Like

YAY! That’s awesome.

It’s been fun. I’m new to Thunkable, and the best way to learn anything is to solve the issues other people are having, and I’ve leaned a lot through the process myself. :smiley:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.