How to check if list contains a keyword
Question
Application Type
Reactive

Hello! I'm working on an app where i have input field where user inputs their searchword. I have the user input saved in a client variable called Client.SearchWord. I'm then using it currently in a listfilter action, it works but im only able to filter the list by example firstname or lastname.

The list looks looks like this:

{

            "email": "",

            "firstName": "",

            "lastName": "",

            "company": "",

            "city": "",

            "phone": "",

            "status": true,

            "systems":  [

                {

                    "name": "",

                    "role": "",

                    "lastNotification": ""

                }

            ]

        },

I have a  structure  according to the json above, I removed the values, please treat it like it contains some dummydata. Is it possible to somehow check if any of the objects above matches the user keyword, and then display the results on a table in a screen?

Hi Ronivil,

You can achieve this by below process.

convert your  whole JSON to text by using jSON serialize by passing JSON structure as input.

Then the Output of JSON serialize used in built text function (index) to get the keyword is available or not

If this returns>-1, that means keyword is available otherwise not.


Hope this will help you.

Dileep

Hello and thanks for your answer! I'm deserializing the json inside CS module and then importing the data to the ui module. Im not sure how to implement that solution, because i cannot use client.searchword inside cs module. And im also getting an error  "Text data  type required instead of "thisStructure"

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.