#Filtered table not having correct data validation

1 messages · Page 1 of 1 (latest)

tacit sparrow
#

I have a table where the data validation for an editiable column is {{currentRow.quantity}} and this works fine normally.

However if I filter the table such that row 3 and 4 now occupy rows 1 and 2, when I fill out the editable column, the data validation is as if it was in the row it now occupies.

For exmaple, if for example table id | quantity
10 | 1
11 | 7
20 | 5
21 | 40

If I were to search by "2" it would put 20 and 21 in rows 1 and 2. Then if I were to go to the editable column for id 21 and type in 6 it would say there is no issue, but if I type in 8 it would say invalid response.

I'm on self-hosted 1.9.60

split spearBOT
#

Hello, I am AppySmith, your Appsmith support bot! The issue you're encountering
with table data validation after filtering is due to the currentRow reference
updating according to the filtered view, which changes the row index. In
Appsmith, the currentRow object references the data in the table row as it is
currently being rendered, which includes any filters or sorting applied. The
validation is working based on the filtered indices rather than the original
data indices. To address this, you will need to refer to the original,
unfiltered data source for your validation. Without seeing the exact setup of
your table and data, I can suggest a general approach: 1. Save your original,
unfiltered data in a separate widget state (perhaps using a store value action
or as appsmith.store.myTableData). 2. Use a custom validation function that
looks up the correct row in the original data based on an identifier (like the
id in your case) rather than relying on the row index. 3. Within that
function, perform the required validation lookup based on the original rows, not
the currently filtered row positions. For further details on how to implement
this or if you need help with the specific code, I may need more information
about how your table is set up and how your data source is configured. If the
general approach is not clear, or you need additional help, please let me know!
If you don't find my response helpful, you can request to speak to a human agent

tacit sparrow
#

You've got this backwards, I would LIKE this to be based on the filtered indices but for some reason it's doing it based on the original.

#

Or wait, this doesn't make sense. Please put on a human agent

split spearBOT
#

Someone from our team will reach out to you on this thread. In the meantime, you
can have a look at our documentation to try & resolve your query
https://docs.appsmith.com?utm=bot

Organizations build internal applications such as dashboards, database GUIs, admin panels, approval apps, customer support tools, etc. to help improve their business operations. Appsmith is an open-source developer tool that enables the rapid development of these applications. You can drag and drop pre-built widgets to build UI. Connect securely...

split spearBOT
#

Hello @tacit sparrow!

I'm able to replicate this on my end as well. Could you please help us file a
bug using the following link?

https://github.com/appsmithorg/appsmith/issues/new/choose

Please include your use case. Once you've created the GitHub issue send us the
link to it so we can tag it and forward it to our development team.

GitHub

GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

tacit sparrow