#Filter

1 messages · Page 1 of 1 (latest)

marble thunder
#

I have a table and I would like to press a button to activate preconfigured filters how would I do this

bold idolBOT
#

Hello! I'm Smithy, your support bot built to help with Appsmith queries. To add
a button that activates pre-configured filters on a table in Appsmith, you would
typically follow these steps: 1. Place a Button widget on the canvas where you
want the button to be. 2. In the Button widget's properties pane, locate the
"onClick" property. 3. For the onClick action, you need to write JavaScript code
that sets the desired filter on your Table widget. 4. If your table is bound to
a query or API that fetches data, you might also need to trigger that query or
API with the new filters. Would you like to know how to write the JavaScript
code for the table filter and for triggering the data source or do you need
information on how to set up the Button widget itself? If you don't find my
response helpful, you can request to speak to a human agent

marble thunder
#

I am trying to run a query and in the filter applied on data how do I reference a specific column

bold idolBOT
#

Certainly! When you are setting up a query with filtering in Appsmith, you
typically use a 'where' clause or a filtering parameter that matches data in
your database or API. To reference a specific column in your query filter, you
can do the following: 1. Open the query editor where you have your data fetching
query. 2. Add a filtering condition that references the column you want to
filter by. 3. Use the column name exactly as it is in your data source within
the filter. For example, if your query is fetching data from a SQL database and
you want to filter where the column status is 'active', your 'where' clause in
the SQL query would look like this: sql SELECT * FROM your_table_name WHERE status = 'active' If you're filtering dynamic data within Appsmith, for
instance using a Table widget's default filtering functionality, you could
reference a column like so: javascript {{ Table1.tableData.filter(row => row.status === 'active') }} In the above JavaScript snippet, Table1 is the
name of your Table widget, and status is the name of the column you're
filtering on. Please let me know if you need the snippet tailored to a
particular database or API service, or if you have a specific scenario in mind.
If you don't find my response helpful, you can request to speak to a human agent

marble thunder
#

this is data from google sheets