Trouble with transformer and mobile search

Looks like your clients constant is not array. You may want to wrap it in formatDataAsArray function. And then formatDataAsObject back (see code below).

Also, as @iiLaw mentions, better assign clientSearch to a separate variable (I'm not sure how these transformers work myself).

So your result transformer code may look like this:

const clients = {{ formatDataAsArray(getClientData.data)  }};
const str = {{clientSearch.value.toLowerCase() }}

const result = clients.filter(client => client.client_name.toLowerCase().includes(str));

return formatDataAsObject(result);
1 Like