I try to create a search index text and have managed so far to add multiple categories for an event through a toggle, have also tried with action bars and update current event but i dont manage to find a way to remove a category from the search index text..
A user creates an event and are able to choose between different categories through a toggle, as i said before the added categories also saves into a search index text for other users to be able to search and find the created event.
The relationship i have right now between the event and categories is a many to many relation.
I also use the image list component to show the events, thats why i need to have a search index text, so other users can search and find the event by all the chosen categories.
Maybe there is different way to do this, but this solution is the one i have found working so far
Hope this wasnt to messy, but to the question, how can i use toggle / action bars to remove a category from the search index text? needed if the user change their mind about one category when picking or just want to change their event categories.
Honestly I think the search index text is making this way harder than it needs to be. You can skip it entirely and filter directly with your many-to-many relationship.
Here’s what I’d do:
1. New field on Users
Add a number field to Users, call it something like Selected Category ID. That’s where you store which category the user is currently looking at.
2. Let the user pick a category
You can use a simple Dropdown, or if you have 5 categories or less, check out my Pro Switch Tab component — works great for this.
3. On tap / selection
When the user picks a category, just do:
Update → Logged In User → Selected Category ID → the ID of that category
So “Music” = ID 3, you save 3. Simple.
Also add a Change Input Value → empty on each tap so the search text resets.
4. Filter the Image List
Two filters on the same list:
Current Event → Category ID → is equal to → Logged In User → Selected Category ID
Current Event → Event Name → contains → Search Input value
First one handles the category, second one lets users search by name within that category. They work together so the user sees only events that match both the selected category AND whatever they type.
That’s it, no more dealing with adding/removing text from a string. Way simpler to manage
Thanks for the help, but i might have described it wrong. This seems like a good solution for a filtering function for the logged in user in a image list that shows all the events in the app.
Or my brain is just fried after 7-8 months in the Adalo Builder and i did not understand your reply
Its a tab that shows all the events in the app and a search bar, the goal is that a logged in user can find events by searching on event name and event categories with the end goal to give every creator a chance to be seen by using category search aswell not only name.
When you create a event you have the option to choose between different categories that matches what the event is gonna be about. The chosen categories is stored correctly in the database for the current event but i dont know how to show the stored categories as text for the current event in the image list off all events created in the app.
Thats why i tried with a search index, because then i could store the chosen categories in that search index and later show that search index as text for the event so other users are able to find the event by searching for a category.
It seems like it would be easy if i could just show the current event > categories but im not able to do that.. i just have the option to show current event > categories > count in the text field..
I got the same result if i try to create a custom list myself like the image list and try to do this as text.
Am i totaly lost or can i do this another way without a search index text? Tried some other stuff aswell but only end up to show the count and it does not really help me
And i have realised that i only can use one text string for the search by using the image list but this is just for testing atm.
Thats why i try to find a way to remove a category somehow from the search index so the user can change and regret a choice. dont wanna force a user to delete their event if they need to change a category
Hey Anton! Ok now I understand better what you’re trying to do
The reason you only see the count when you try to show categories is because it’s a many-to-many, Adalo doesn’t know which category name to display when there are multiple ones.
The trick is: nest a list inside your list.
Here’s the setup
Instead of using the default Image List, build a Custom List:
Outer list = your events
What is this list of? → Explore Events
Image component → Current Event > Image
Text → Current Event > Name
Inner list (inside each event card) = the categories for that event
Add a Simple text made as List inside the event card, set it to 3 or 4 columns
What is this list of? → Categories
Filter → Current Event > Categories
Text → Current Category > Name
That’s it. Each event card now shows all its categories as text. No search index needed to display them.
I’m not sure if I understood the question here, Anton! Do you want to show the categories under each event or just want the events to be searchable by the event name & category names, or show the categories under each event + make the events list searchable by the event name & category names? Thank you and have a great day!
Oh yes this is what i was trying to describe earlier ! Thanks for the patience!!
My app is kinda big for the adalo builder at the moment so my text input search and custom filters cant load properly so i cannot try the search function…
But the first list with explore event i set the custom filter to Name > Contains > Text Input and the nested list with Current Explore Event > Sub Categories with Name > Contains > Text Input.
Is this gonna show the correct data when a user using the Text Input (Search solution)? or am i in trouble here?
@Eugen ok i manage to try the text input search, it works well when i search for Name in the Explore Event Custom List, but do you know if it is possible to search for the categories in the nested list aswell? Since its nested i cant manage to make it searchable
Since the main list is the Event List and you are filtering that one based on the search input, I don’t think you can directly filter also the Categories nested list from that input. But, as I suggested you earlier, the beast approach will be having Category Selection on top of your Event List and Filter the Event List based on that, as I explained in the first comment.
Look this example :
Everything is possible with Adalo, expecially with Custom Components. But even without, you can obtain the same result in many ways. Thanks for the offer, I will accept that beer if I come to Sweden