Showing/hiding records in Data Viewer based on keyword in a specified column

Hey y’all,

Recently, I tried to make a Data Viewer List (with Google Sheets) for my project with filters (using switches)… I’ve never done this before so I was kind of just trying to butcher it and see if it could work. So how it was supposed to work is that if say this switch was turned on and it was for finance related searches, then then when the DVL loads it will search whether the rows has the keyword “Financial” in column “ResourceType”, and if this were true then i would set the visible property to true and if not then it would set the visible property to false. Well, that did not work at all and the DVL was still showing all records so I was hoping you guys could help me and tell me what is wrong with it :sweat_smile:

Yes, I know similar topics do exist but l felt confused looking at the sample project solutions and was really you guys would help explain to me how this works…

Thank you so much and sorry in advance :sweat_smile:

1 Like

See this sample project

https://x.thunkable.com/projectPage/5fb9fb1dbfeb240011084d78

The idea here is to get the selected criteria and then loop through the main table selecting only the rows that fit the criteria and append them to the table bound to the Data Viewer List which will display the selected rows.

1 Like

Wow, thank you so much Muneer! :grin:

How would you do this for multiple keywords? Like if I wanted to see data that has the value “Financial” or “Info” in the “ResourceType” column.

I just spent around 2 hours figuring out how to do that and for my latest try I tried reusing the idea from your sample project and tried to loop for multiple criterias while in the loop for checking all the rows:

I put the criterias in a list to loop them later on:

Well, the result was 50/50 and while some data was working as expected some also absolutely did not show at all even when it was supposed to.

I would be very glad if you would explain to me what went wrong :sweat_smile:

Thanks again :grinning:

1 Like

I added a new screen in the project. you need to click the link again so you can get the updated project.

Let me know if this is what you want.

Yes, yes, yes, this was exactly what I needed!

While there seems to be output lag it’s easily hideable with wait blocks and loading icons :grinning:

Thank you so so much for the big help, @muneer ! :grin: :grin:

2 Likes

Glad it helped you. The code can be optimised and would work faster. My intention is to get the workaround functioning and the speed comes later.

1 Like